hopefully fixup UP on linux when backgrounded
This commit is contained in:
parent
3fee789c90
commit
3d690c26d8
2 changed files with 8 additions and 1 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue