1
0
mirror of https://github.com/keeweb/keeweb.git synced 2024-06-21 07:06:39 +02:00

#674, Move fingerprint reset code to setSyncComplete

This commit is contained in:
Alex Shpak 2019-01-09 23:25:45 +01:00
parent b9ffe62e8b
commit a740c51d82
3 changed files with 8 additions and 9 deletions

View File

@ -1025,7 +1025,7 @@ const AppModel = Backbone.Model.extend({
const fileInfo = this.fileInfos.get(file.id);
Launcher.fingerprints.register(file.id, password, token => {
if (token) {
fileInfo.set('fingerprint', token);
fileInfo.set({ fingerprint: token });
this.fileInfos.save();
}
});

View File

@ -421,6 +421,12 @@ const FileModel = Backbone.Model.extend({
syncing: false,
syncError: error
});
const shouldResetFingerprint = this.get('passwordChanged') && this.has('fingerprint');
if (shouldResetFingerprint && !error) {
this.set({ fingerprint: null });
}
if (!this.get('open')) {
return;
}

View File

@ -164,14 +164,7 @@ const SettingsFileView = Backbone.View.extend({
}
}
// save to erase old password from fingerprint store after sync
const shouldUpdateFingerprint = this.model.get('passwordChanged') && this.model.get('fingerprint');
this.appModel.syncFile(this.model, arg, () => {
if (shouldUpdateFingerprint) {
this.model.set('fingerprint', null);
}
});
this.appModel.syncFile(this.model, arg);
},
saveDefault: function() {