mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Synchronize fs close
This commit is contained in:
parent
6dd0e6d255
commit
f4f3f21a70
1 changed files with 20 additions and 18 deletions
|
@ -100,25 +100,27 @@ public final class OpenFileSystemModel extends BrowserSessionTab<FileSystemStore
|
|||
|
||||
@Override
|
||||
public void close() {
|
||||
if (fileSystem == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (DataStorage.get().getStoreEntries().contains(getEntry().get())
|
||||
&& savedState != null
|
||||
&& getCurrentPath().get() != null) {
|
||||
if (getBrowserModel() instanceof BrowserSessionModel bm) {
|
||||
bm.getSavedState()
|
||||
.add(new BrowserSavedState.Entry(
|
||||
getEntry().get().getUuid(), getCurrentPath().get()));
|
||||
BooleanScope.execute(busy, () -> {
|
||||
if (fileSystem == null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
try {
|
||||
fileSystem.close();
|
||||
} catch (IOException e) {
|
||||
ErrorEvent.fromThrowable(e).handle();
|
||||
}
|
||||
fileSystem = null;
|
||||
|
||||
if (DataStorage.get().getStoreEntries().contains(getEntry().get())
|
||||
&& savedState != null
|
||||
&& getCurrentPath().get() != null) {
|
||||
if (getBrowserModel() instanceof BrowserSessionModel bm) {
|
||||
bm.getSavedState()
|
||||
.add(new BrowserSavedState.Entry(
|
||||
getEntry().get().getUuid(), getCurrentPath().get()));
|
||||
}
|
||||
}
|
||||
try {
|
||||
fileSystem.close();
|
||||
} catch (IOException e) {
|
||||
ErrorEvent.fromThrowable(e).handle();
|
||||
}
|
||||
fileSystem = null;
|
||||
});
|
||||
}
|
||||
|
||||
private void startIfNeeded() throws Exception {
|
||||
|
|
Loading…
Reference in a new issue