mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-12 02:58:20 +08:00
fix(key): only migrate if key doesn't exist
This commit is contained in:
parent
ace9b94053
commit
d624f6657a
1 changed files with 3 additions and 3 deletions
|
@ -33,15 +33,15 @@ class KeyManager {
|
|||
}
|
||||
|
||||
getPassword(keyName, {migrateFromService} = {}) {
|
||||
if (migrateFromService && !this._alreadyMigrated.has(migrateFromService)) {
|
||||
const keys = this._getKeyHash();
|
||||
if (!keys[keyName] && migrateFromService &&
|
||||
!this._alreadyMigrated.has(migrateFromService)) {
|
||||
const oldVal = keytar.getPassword(migrateFromService, keyName);
|
||||
if (oldVal) {
|
||||
this.replacePassword(keyName, oldVal)
|
||||
keytar.deletePassword(migrateFromService, keyName);
|
||||
this._alreadyMigrated.add(migrateFromService)
|
||||
}
|
||||
}
|
||||
const keys = this._getKeyHash();
|
||||
return keys[keyName]
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue