Improve tab init fail handling

This commit is contained in:
crschnick
2025-03-22 14:53:26 +00:00
parent bc0e14a332
commit 3c13cf5e2a
2 changed files with 5 additions and 2 deletions
@@ -24,6 +24,9 @@ public class BrowserAbstractSessionModel<T extends BrowserSessionTab> {
public void closeAsync(BrowserSessionTab e) {
ThreadHelper.runAsync(() -> {
// This is a bit ugly
// If we die on tab init, wait a bit with closing to avoid removal while it is still being inited/added
ThreadHelper.sleep(100);
closeSync(e);
});
}
@@ -156,8 +156,8 @@ public final class BrowserFileListComp extends SimpleComp {
var os = fileList.getFileSystemModel()
.getFileSystem()
.getShell()
.orElseThrow()
.getOsType();
.map(shellControl -> shellControl.getOsType())
.orElse(null);
table.widthProperty().subscribe((newValue) -> {
if (os != OsType.WINDOWS && os != OsType.MACOS) {
ownerCol.setVisible(newValue.doubleValue() > 1000);