fix: web download dir setting (#46)

This commit is contained in:
monkeyWie authored and GitHub committed 2022-11-08 14:31:49 +08:00
1 parent 35156ed968
commit 57befd2c03
1 file changed
+4 -5
+4 -5
View File
@@ -13,7 +13,7 @@ class Setting {
String host = "127.0.0.1"; String host = "127.0.0.1";
int port = 0; int port = 0;
int connections = 0; int connections = 0;
String downloadDir = ""; late String downloadDir;
late ThemeMode themeMode; late ThemeMode themeMode;
late String locale; late String locale;
@@ -44,10 +44,6 @@ class Setting {
this.locale = locale; this.locale = locale;
} }
if (Util.isWeb()) {
downloadDir = "./";
return;
}
if (Util.isAndroid()) { if (Util.isAndroid()) {
downloadDir = downloadDir =
'${await ExternalPath.getExternalStoragePublicDirectory(ExternalPath.DIRECTORY_DOWNLOADS)}/com.gopeed'; '${await ExternalPath.getExternalStoragePublicDirectory(ExternalPath.DIRECTORY_DOWNLOADS)}/com.gopeed';
@@ -55,6 +51,9 @@ class Setting {
} }
if (downloadDir.isEmpty) { if (downloadDir.isEmpty) {
if (Util.isWeb()) {
downloadDir = './';
}
if (Util.isDesktop()) { if (Util.isDesktop()) {
downloadDir = (await getDownloadsDirectory())!.path; downloadDir = (await getDownloadsDirectory())!.path;
} }