From 63183e08247c23b17b98097d76cdf45c8f7e6f90 Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Wed, 16 Sep 2026 21:59:55 -0400 Subject: [PATCH] don't init UP on platforms other than Linux or Android --- lib/controllers/unified_push.dart | 2 ++ lib/controllers/unified_push_allowed.dart | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/controllers/unified_push.dart b/lib/controllers/unified_push.dart index 0be46cb..ea8258b 100644 --- a/lib/controllers/unified_push.dart +++ b/lib/controllers/unified_push.dart @@ -21,6 +21,8 @@ import "package:window_manager/window_manager.dart"; class UnifiedPushController extends AsyncNotifier { @override Future build() async { + if (Platform.isLinux ^ Platform.isAndroid) return false; + final client = ref.watch(ClientController.provider.notifier); final registered = await UnifiedPush.initialize( linuxOptions: .new( diff --git a/lib/controllers/unified_push_allowed.dart b/lib/controllers/unified_push_allowed.dart index af50d62..8f7fd8e 100644 --- a/lib/controllers/unified_push_allowed.dart +++ b/lib/controllers/unified_push_allowed.dart @@ -8,11 +8,11 @@ class UnifiedPushAllowedController extends AsyncNotifier { @override Future build() async { if (!await UnifiedPush.tryUseCurrentOrDefaultDistributor()) { - return "No valid distributors found. Try installing ${Platform.isLinux - ? "KUnifiedPush" + return "No valid distributors found. ${Platform.isLinux + ? "Try installing KUnifiedPush" : Platform.isAndroid - ? "Google Play Services or NTFY" - : "NTFY"}."; + ? "Try installing Google Play Services or NTFY" + : "Your platform is not currently supported by UnifiedPush"}."; } final capabilities = await ref