mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
improved error handling in case of errors during initial tabs loading
This commit is contained in:
parent
173b28062e
commit
587387dd46
@ -48,6 +48,7 @@ export default class TabManager extends Component {
|
||||
}
|
||||
|
||||
async loadTabs() {
|
||||
try {
|
||||
const tabsToOpen = appContext.isMainWindow
|
||||
? (options.getJson('openTabs') || [])
|
||||
: [];
|
||||
@ -66,8 +67,8 @@ export default class TabManager extends Component {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!froca.getNoteFromCache(openTab.hoistedNoteId)) {
|
||||
continue;
|
||||
if (!(openTab.hoistedNoteId in froca.notes)) {
|
||||
openTab.hoistedNoteId = 'root';
|
||||
}
|
||||
|
||||
filteredTabs.push(openTab);
|
||||
@ -104,6 +105,13 @@ export default class TabManager extends Component {
|
||||
await appContext.tabManager.switchToNoteContext(ntxId, notePath);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
logError(`Loading tabs '${options.get('openTabs')}' failed: ${e.message}`);
|
||||
|
||||
// try to recover
|
||||
await this.openEmptyTab();
|
||||
}
|
||||
}
|
||||
|
||||
noteSwitchedEvent({noteContext}) {
|
||||
if (noteContext.isActive()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user