refactoring of access to options in frontend

This commit is contained in:
zadam
2019-08-22 23:31:02 +02:00
parent b84542064c
commit f9abea83f3
13 changed files with 93 additions and 62 deletions

View File

@@ -331,16 +331,9 @@ async function treeInitialized() {
return;
}
let openTabs = [];
const options = await optionsInit.waitForOptions();
try {
const options = await optionsInit.optionsReady;
openTabs = JSON.parse(options.openTabs);
}
catch (e) {
messagingService.logError("Cannot retrieve open tabs: " + e.stack);
}
const openTabs = options.getJson('openTabs') || [];
// if there's notePath in the URL, make sure it's open and active
// (useful, among others, for opening clipped notes from clipper)