Moved password insertion

This commit is contained in:
Alex Shpak 2017-05-26 00:11:10 +02:00
parent 59fa9253b3
commit dd850197e4
1 changed files with 16 additions and 14 deletions

View File

@ -378,20 +378,6 @@ const OpenView = Backbone.View.extend({
const fileInfo = this.model.fileInfos.get(id);
this.showOpenFileInfo(fileInfo);
if (fileInfo && Launcher && Launcher.fingerprints) {
this.openFileWithFingerprint(fileInfo);
}
},
openFileWithFingerprint(fileInfo) {
if (fileInfo.get('fingerprint')) {
Launcher.fingerprints.auth(fileInfo.id, fileInfo.get('fingerprint'), password => {
this.inputEl.val(password);
this.inputEl.trigger('input');
this.openDb();
});
}
},
removeFile: function(id) {
@ -515,6 +501,8 @@ const OpenView = Backbone.View.extend({
this.params.keyFileData = null;
this.displayOpenFile();
this.displayOpenKeyFile();
this.openFileWithFingerprint(fileInfo)
},
showOpenLocalFile: function(path, keyFilePath) {
@ -537,6 +525,20 @@ const OpenView = Backbone.View.extend({
}
},
openFileWithFingerprint: function(fileInfo) {
if (!fileInfo.has('fingerprint')) {
return;
}
if (Launcher && Launcher.fingerprints) {
Launcher.fingerprints.auth(fileInfo.id, fileInfo.get('fingerprint'), password => {
this.inputEl.val(password);
this.inputEl.trigger('input');
this.openDb();
});
}
},
createDemo: function() {
if (!this.busy) {
this.closeConfig();