forked from Nexus/nexus
don't init UP on platforms other than Linux or Android
This commit is contained in:
parent
163947fc90
commit
63183e0824
2 changed files with 6 additions and 4 deletions
|
|
@ -21,6 +21,8 @@ import "package:window_manager/window_manager.dart";
|
||||||
class UnifiedPushController extends AsyncNotifier<bool> {
|
class UnifiedPushController extends AsyncNotifier<bool> {
|
||||||
@override
|
@override
|
||||||
Future<bool> build() async {
|
Future<bool> build() async {
|
||||||
|
if (Platform.isLinux ^ Platform.isAndroid) return false;
|
||||||
|
|
||||||
final client = ref.watch(ClientController.provider.notifier);
|
final client = ref.watch(ClientController.provider.notifier);
|
||||||
final registered = await UnifiedPush.initialize(
|
final registered = await UnifiedPush.initialize(
|
||||||
linuxOptions: .new(
|
linuxOptions: .new(
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,11 @@ class UnifiedPushAllowedController extends AsyncNotifier<String?> {
|
||||||
@override
|
@override
|
||||||
Future<String?> build() async {
|
Future<String?> build() async {
|
||||||
if (!await UnifiedPush.tryUseCurrentOrDefaultDistributor()) {
|
if (!await UnifiedPush.tryUseCurrentOrDefaultDistributor()) {
|
||||||
return "No valid distributors found. Try installing ${Platform.isLinux
|
return "No valid distributors found. ${Platform.isLinux
|
||||||
? "KUnifiedPush"
|
? "Try installing KUnifiedPush"
|
||||||
: Platform.isAndroid
|
: Platform.isAndroid
|
||||||
? "Google Play Services or NTFY"
|
? "Try installing Google Play Services or NTFY"
|
||||||
: "NTFY"}.";
|
: "Your platform is not currently supported by UnifiedPush"}.";
|
||||||
}
|
}
|
||||||
|
|
||||||
final capabilities = await ref
|
final capabilities = await ref
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue