fix: incorrect storage path in linux (#270)

This commit is contained in:
Levi authored and GitHub committed 2023-11-15 16:26:29 +08:00
1 parent 485656d1d4
commit 0a05bf41e7
9 files changed
+164 -85

No files matched your search

@@ -209,6 +209,10 @@ class AppController extends GetxController with WindowListener, TrayListener {
}
Future<void> _initForegroundTask() async {
if (!Util.isMobile()) {
return;
}
FlutterForegroundTask.init(
androidNotificationOptions: AndroidNotificationOptions(
channelId: 'gopeed_service',
@@ -269,13 +273,8 @@ class AppController extends GetxController with WindowListener, TrayListener {
_defaultStartConfig!.address = "127.0.0.1:0";
} else {
_defaultStartConfig!.network = "unix";
if (Util.isDesktop()) {
_defaultStartConfig!.address = unixSocketPath;
}
if (Util.isMobile()) {
_defaultStartConfig!.address =
"${(await getTemporaryDirectory()).path}/$unixSocketPath";
}
_defaultStartConfig!.address =
"${(await getTemporaryDirectory()).path}/$unixSocketPath";
}
_defaultStartConfig!.apiToken = '';
return _defaultStartConfig!;