Fix linux startup

This commit is contained in:
problematicconsumer
2023-07-23 13:40:59 +03:30
parent b92f4eb148
commit acc438c40e
2 changed files with 10 additions and 3 deletions

View File

@@ -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<NewProfileLink?> 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(() {

View File

@@ -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());
}