Pass vault state (locked/unlocked) to notificationBar

This commit is contained in:
Daniel James Smith 2021-09-30 16:09:42 +02:00
parent 210e0801ff
commit 686c7fbfff
No known key found for this signature in database
GPG Key ID: 03E4BD365FF06726
3 changed files with 10 additions and 2 deletions

View File

@ -676,13 +676,20 @@ export default class MainBackground {
if (this.notificationQueue[i].tabId !== tab.id || this.notificationQueue[i].domain !== tabDomain) {
continue;
}
if (this.notificationQueue[i].type === 'addLogin') {
BrowserApi.tabSendMessageData(tab, 'openNotificationBar', {
type: 'add',
typeData: {
isVaultLocked: this.notificationQueue[i].wasVaultLocked,
},
});
} else if (this.notificationQueue[i].type === 'changePassword') {
BrowserApi.tabSendMessageData(tab, 'openNotificationBar', {
type: 'change',
typeData: {
isVaultLocked: this.notificationQueue[i].wasVaultLocked,
},
});
}
break;

View File

@ -444,10 +444,10 @@ document.addEventListener('DOMContentLoaded', event => {
barPage = barPage + '?success=' + typeData.text;
break;
case 'add':
barPage = barPage + '?add=1';
barPage = barPage + '?add=1&isVaultLocked=' + typeData.isVaultLocked;
break;
case 'change':
barPage = barPage + '?change=1';
barPage = barPage + '?change=1&isVaultLocked=' + typeData.isVaultLocked;
break;
default:
break;

View File

@ -20,6 +20,7 @@ document.addEventListener('DOMContentLoaded', () => {
setTimeout(load, 50);
function load() {
const isVaultLocked = getQueryVariable('isVaultLocked') == 'true';
var closeButton = document.getElementById('close-button'),
body = document.querySelector('body'),
bodyRect = body.getBoundingClientRect();