mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-19 23:54:01 +08:00
feat: load config from text (#1772)
* feat: load config from text * opt: login utils * update Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me> --------- Co-authored-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
committed by
GitHub
parent
b4daf5fbd8
commit
244ef22f54
@@ -72,10 +72,10 @@ abstract class GStorage {
|
||||
importAllJsonSettings(jsonDecode(data));
|
||||
|
||||
static Future<bool> importAllJsonSettings(Map<String, dynamic> map) async {
|
||||
await setting.clear();
|
||||
await video.clear();
|
||||
await setting.putAll(map[setting.name]);
|
||||
await video.putAll(map[video.name]);
|
||||
await Future.wait([
|
||||
setting.clear().then((_) => setting.putAll(map[setting.name])),
|
||||
video.clear().then((_) => video.putAll(map[video.name])),
|
||||
]);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user