fix remote home button
Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>
This commit is contained in:
parent
d7036aae48
commit
9acddede65
@ -375,8 +375,14 @@ class FileController {
|
|||||||
history.add(directory.value.path);
|
history.add(directory.value.path);
|
||||||
}
|
}
|
||||||
|
|
||||||
void goToHomeDirectory() {
|
void goToHomeDirectory() async {
|
||||||
openDirectory(homePath);
|
if (isLocal) {
|
||||||
|
openDirectory(homePath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final homeDir = (await bind.sessionGetPeerOption(
|
||||||
|
sessionId: sessionId, name: "remote_home_dir"));
|
||||||
|
openDirectory(homeDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
void goBack() {
|
void goBack() {
|
||||||
@ -403,7 +409,7 @@ class FileController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO deprecated this
|
// TODO deprecated this
|
||||||
void initDirAndHome(Map<String, dynamic> evt) {
|
void initDirAndHome(Map<String, dynamic> evt) async {
|
||||||
try {
|
try {
|
||||||
final fd = FileDirectory.fromJson(jsonDecode(evt['value']));
|
final fd = FileDirectory.fromJson(jsonDecode(evt['value']));
|
||||||
fd.format(options.value.isWindows, sort: sortBy.value);
|
fd.format(options.value.isWindows, sort: sortBy.value);
|
||||||
@ -423,6 +429,14 @@ class FileController {
|
|||||||
}
|
}
|
||||||
} else if (options.value.home.isEmpty) {
|
} else if (options.value.home.isEmpty) {
|
||||||
options.value.home = fd.path;
|
options.value.home = fd.path;
|
||||||
|
|
||||||
|
final homeDir = ( await bind.sessionGetPeerOption(
|
||||||
|
sessionId: sessionId, name: "remote_home_dir"));
|
||||||
|
|
||||||
|
if (homeDir.isEmpty){
|
||||||
|
bind.sessionPeerOption(
|
||||||
|
sessionId: sessionId, name: "remote_home_dir", value: fd.path);
|
||||||
|
}
|
||||||
debugPrint("init remote home: ${fd.path}");
|
debugPrint("init remote home: ${fd.path}");
|
||||||
directory.value = fd;
|
directory.value = fd;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user