Fix linux startup
This commit is contained in:
@@ -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(() {
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user