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() {
|
async loadTabs() {
|
||||||
|
try {
|
||||||
const tabsToOpen = appContext.isMainWindow
|
const tabsToOpen = appContext.isMainWindow
|
||||||
? (options.getJson('openTabs') || [])
|
? (options.getJson('openTabs') || [])
|
||||||
: [];
|
: [];
|
||||||
@ -66,8 +67,8 @@ export default class TabManager extends Component {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!froca.getNoteFromCache(openTab.hoistedNoteId)) {
|
if (!(openTab.hoistedNoteId in froca.notes)) {
|
||||||
continue;
|
openTab.hoistedNoteId = 'root';
|
||||||
}
|
}
|
||||||
|
|
||||||
filteredTabs.push(openTab);
|
filteredTabs.push(openTab);
|
||||||
@ -104,6 +105,13 @@ export default class TabManager extends Component {
|
|||||||
await appContext.tabManager.switchToNoteContext(ntxId, notePath);
|
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}) {
|
noteSwitchedEvent({noteContext}) {
|
||||||
if (noteContext.isActive()) {
|
if (noteContext.isActive()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user