Ensure minimum size for desktop app

This commit is contained in:
Eduard Urbach 2018-10-28 11:31:43 +09:00
parent 2449ce824c
commit 6201818d3b
2 changed files with 13 additions and 0 deletions

View File

@ -52,6 +52,8 @@ func configure(app *aero.Application) *aero.Application {
// Development server configuration
if arn.IsDevelopment() {
app.Config.Domain = "beta.notify.moe"
app.Config.Title += " - Beta"
app.Config.Manifest.Name = app.Config.Title
// Test connectivity
app.OnStart(testConnectivity)

View File

@ -224,6 +224,17 @@ export default class AnimeNotifier {
document.getElementsByClassName("speech-input")[0].classList.add("speech-input-available")
}
// Ensure a minimum size for the desktop app
const minWidth = 1420
const minHeight = 800
if(window.outerWidth <= minWidth || window.outerHeight <= minHeight) {
let finalWidth = window.outerWidth < minWidth ? minWidth : window.outerWidth
let finalHeight = window.outerHeight < minHeight ? minHeight : window.outerHeight
window.resizeTo(finalWidth, finalHeight)
}
// // Download popular anime titles for the search
// let response = await fetch("/api/popular/anime/titles/500")
// let titles = await response.json()