Skip to content

An open-source cross-platform alternative to AirDrop

fix: add await when setting window size

Tien Do Nam7e7ececf309e
diff --git a/lib/init.dart b/lib/init.dart
index ccd8cd05..e9bc71c4 100644
--- a/lib/init.dart
+++ b/lib/init.dart
@@ -85,18 +85,18 @@ Future<PersistenceService> preInit(List<String> args) async {
await initTray();
// initialize size and position
- final primaryDisplay = await screenRetriever.getPrimaryDisplay();
+ final primaryDisplay = await ScreenRetriever.instance.getPrimaryDisplay();
final width = (primaryDisplay.visibleSize ?? primaryDisplay.size).width;
if (width >= 1200) {
// make initial window size bigger as our display is big enough
- windowManager.setSize(const Size(900, 600));
+ await WindowManager.instance.setSize(const Size(900, 600));
}
- await windowManager.center();
+ await WindowManager.instance.center();
if (!args.contains(launchAtStartupArg) || !persistenceService.isAutoStartLaunchMinimized()) {
// We show this app, when (1) app started manually, (2) app should not start minimized
// In other words: only start minimized when launched on startup and "launchMinimized" is configured
- await windowManager.show();
+ await WindowManager.instance.show();
}
}