mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-28 17:27:50 +01:00
default lock options to "on restart"
This commit is contained in:
parent
c942dd3410
commit
4a34f9be59
@ -272,9 +272,10 @@ export default class RuntimeBackground {
|
||||
|
||||
if (reason === 'install') {
|
||||
BrowserApi.createNewTab(gettingStartedUrl);
|
||||
await this.setDefaultSettings();
|
||||
}
|
||||
} else if (this.runtime.onInstalled) {
|
||||
this.runtime.onInstalled.addListener((details: any) => {
|
||||
this.runtime.onInstalled.addListener(async (details: any) => {
|
||||
(window as any).ga('send', {
|
||||
hitType: 'event',
|
||||
eventAction: 'onInstalled ' + details.reason,
|
||||
@ -282,11 +283,20 @@ export default class RuntimeBackground {
|
||||
|
||||
if (details.reason === 'install') {
|
||||
BrowserApi.createNewTab(gettingStartedUrl);
|
||||
await this.setDefaultSettings();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private async setDefaultSettings() {
|
||||
// Default lock options to "on restart".
|
||||
const currentLockOption = await this.storageService.get<number>(ConstantsService.lockOptionKey);
|
||||
if (currentLockOption == null) {
|
||||
await this.storageService.save(ConstantsService.lockOptionKey, -1);
|
||||
}
|
||||
}
|
||||
|
||||
private async getDataForTab(tab: any, responseCommand: string) {
|
||||
const responseData: any = {};
|
||||
if (responseCommand === 'notificationBarDataResponse') {
|
||||
|
Loading…
Reference in New Issue
Block a user