mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 10:43:35 +00:00
added option to disable auto totp copying
This commit is contained in:
@@ -3,6 +3,7 @@ function ConstantsService() {
|
||||
disableGaKey: 'disableGa',
|
||||
disableAddLoginNotificationKey: 'disableAddLoginNotification',
|
||||
disableContextMenuItemKey: 'disableContextMenuItem',
|
||||
disableAutoTotpCopyKey: 'disableAutoTotpCopy',
|
||||
lockOptionKey: 'lockOption',
|
||||
lastActiveKey: 'lastActive',
|
||||
encType: {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
function TotpService() {
|
||||
function TotpService(constantsService) {
|
||||
this.constantsService = constantsService;
|
||||
initTotpService();
|
||||
}
|
||||
|
||||
@@ -105,4 +106,20 @@ function initTotpService() {
|
||||
return otp;
|
||||
});
|
||||
};
|
||||
|
||||
TotpService.prototype.isAutoCopyEnabled = function () {
|
||||
var deferred = Q.defer();
|
||||
var self = this;
|
||||
|
||||
chrome.storage.local.get(self.constantsService.disableAutoTotpCopyKey, function (obj) {
|
||||
if (obj && !!obj[self.constantsService.disableAutoTotpCopyKey]) {
|
||||
deferred.resolve(false);
|
||||
}
|
||||
else {
|
||||
deferred.resolve(true);
|
||||
}
|
||||
});
|
||||
|
||||
return deferred.promise;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user