From e0240c6884a433e843e71d2c08b73fdca9fd9551 Mon Sep 17 00:00:00 2001 From: Daniel James Smith Date: Thu, 30 Sep 2021 16:13:29 +0200 Subject: [PATCH] Only retrieve folder list when vault is unlocked --- src/notification/bar.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/notification/bar.js b/src/notification/bar.js index affa1e81b6..6bfa9a2249 100644 --- a/src/notification/bar.js +++ b/src/notification/bar.js @@ -70,16 +70,18 @@ document.addEventListener('DOMContentLoaded', () => { }); }); - const responseFoldersCommand = 'notificationBarGetFoldersList'; - chrome.runtime.onMessage.addListener((msg) => { - if (msg.command === responseFoldersCommand && msg.data) { - fillSelectorWithFolders(msg.data.folders); - } - }); - sendPlatformMessage({ - command: 'bgGetDataForTab', - responseCommand: responseFoldersCommand - }); + if (!isVaultLocked) { + const responseFoldersCommand = 'notificationBarGetFoldersList'; + chrome.runtime.onMessage.addListener((msg) => { + if (msg.command === responseFoldersCommand && msg.data) { + fillSelectorWithFolders(msg.data.folders); + } + }); + sendPlatformMessage({ + command: 'bgGetDataForTab', + responseCommand: responseFoldersCommand + }); + } } else if (getQueryVariable('change')) { setContent(document.getElementById('template-change')); var changeButton = document.querySelector('#template-change-clone .change-save');