fix: LocalStoragePage.initDir

This commit is contained in:
lollipopkit
2023-08-02 19:33:52 +08:00
parent 027b9cc4f7
commit 411bef9320
5 changed files with 86 additions and 81 deletions

View File

@@ -42,13 +42,14 @@ class _LocalStoragePageState extends State<LocalStoragePage> {
@override
void initState() {
super.initState();
sftpDir.then((dir) {
_path = PathWithPrefix(dir.path);
if (widget.initDir != null) {
_path!.update(widget.initDir!.replaceFirst('${dir.path}/', ''));
}
setState(() {});
});
if (widget.initDir != null) {
_path = PathWithPrefix(widget.initDir!);
} else {
sftpDir.then((dir) {
_path = PathWithPrefix(dir.path);
});
}
setState(() {});
}
@override