fix download path settings

This commit is contained in:
wgh19
2024-05-15 20:05:48 +08:00
parent 93c9d14fe2
commit 702fbf42b8
3 changed files with 17 additions and 5 deletions

View File

@@ -279,10 +279,11 @@ class __SetDownloadSubPathPageState extends State<_SetDownloadSubPathPage> {
var text = controller.text;
if (check(text)) {
appdata.settings["downloadSubPath"] = text;
appdata.settings["tagsWeight"] = controller2.text;
appdata.writeData();
context.pop();
} else {
showToast(context, message: "No Permission".tl);
showToast(context, message: "Invalid".tl);
}
},
).toAlign(Alignment.centerRight).paddingRight(16),
@@ -296,10 +297,10 @@ class __SetDownloadSubPathPageState extends State<_SetDownloadSubPathPage> {
}
bool check(String text) {
if (!text.startsWith('/') || !text.startsWith('\\')) {
return false;
if (text.startsWith('/') || text.startsWith('\\')) {
return true;
}
return true;
return false;
}
String get _instruction => """