From acc438c40e6770fe01b387b71997f3643811dbb8 Mon Sep 17 00:00:00 2001 From: problematicconsumer Date: Sun, 23 Jul 2023 13:40:59 +0330 Subject: [PATCH] Fix linux startup --- lib/services/deep_link_service.dart | 8 ++++++-- lib/services/notification/notification_service.dart | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/services/deep_link_service.dart b/lib/services/deep_link_service.dart index 80d076db..2ea3c615 100644 --- a/lib/services/deep_link_service.dart +++ b/lib/services/deep_link_service.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:hiddify/utils/utils.dart'; import 'package:protocol_handler/protocol_handler.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; @@ -11,8 +13,10 @@ class DeepLinkService extends _$DeepLinkService with ProtocolListener, InfraLogger { @override Future build() async { - for (final protocol in _protocols) { - await protocolHandler.register(protocol); + if (!Platform.isLinux) { + for (final protocol in _protocols) { + await protocolHandler.register(protocol); + } } protocolHandler.addListener(this); ref.onDispose(() { diff --git a/lib/services/notification/notification_service.dart b/lib/services/notification/notification_service.dart index dfc76ce2..069bd3ca 100644 --- a/lib/services/notification/notification_service.dart +++ b/lib/services/notification/notification_service.dart @@ -6,7 +6,10 @@ import 'package:hiddify/services/notification/stub_notification_service.dart'; abstract class NotificationService { factory NotificationService() { - if (Platform.isWindows) return StubNotificationService(); + // HACK temporarily return stub for linux as well + if (Platform.isWindows || Platform.isLinux) { + return StubNotificationService(); + } return LocalNotificationService(FlutterLocalNotificationsPlugin()); }