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:
parent
b9ffe62e8b
commit
a740c51d82
|
@ -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();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user