hopefully fixup UP on linux when backgrounded

This commit is contained in:
Henry Hiles 2026-09-20 13:27:47 -04:00
commit 3d690c26d8
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
2 changed files with 8 additions and 1 deletions

View file

@ -68,6 +68,7 @@ class UnifiedPushController extends AsyncNotifier<bool> {
await windowManager.isFocused().onError((_, _) => false) && await windowManager.isFocused().onError((_, _) => false) &&
ref.watch(KeyController.provider(KeyController.roomKey)) == ref.watch(KeyController.provider(KeyController.roomKey)) ==
event.roomId)) { event.roomId)) {
if (isInBackground) exit(0);
return; return;
} }

View file

@ -88,7 +88,13 @@ void main(List<String> args) async {
FlutterError.onError = (FlutterErrorDetails details) => FlutterError.onError = (FlutterErrorDetails details) =>
showError(details.exception.toString(), details.stack); showError(details.exception.toString(), details.stack);
if (!isInBackground) { if (isInBackground) {
await ProviderContainer().read(UnifiedPushController.provider.future);
// In case it didn't exit for some reason
await Future.delayed(Duration(seconds: 20));
exit(0);
} else {
runApp( runApp(
ProviderScope( ProviderScope(
retry: (_, _) => null, retry: (_, _) => null,