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

show last file after lock fix

This commit is contained in:
Antelle 2016-02-06 10:27:11 +03:00
parent 8bf5699cf4
commit 68845b2be8

View File

@ -408,10 +408,13 @@ var AppView = Backbone.View.extend({
},
closeAllFilesAndShowFirst: function() {
var firstFile = this.model.files.find(function(file) { return !file.get('demo') && !file.get('created'); });
var fileToShow = this.model.files.find(function(file) { return !file.get('demo') && !file.get('created'); });
this.model.closeAllFiles();
if (firstFile) {
var fileInfo = this.model.fileInfos.getMatch(firstFile.get('storage'), firstFile.get('name'), firstFile.get('path'));
if (!fileToShow) {
fileToShow = this.model.fileInfos.getLast();
}
if (fileToShow) {
var fileInfo = this.model.fileInfos.getMatch(fileToShow.get('storage'), fileToShow.get('name'), fileToShow.get('path'));
if (fileInfo) {
this.views.open.showOpenFileInfo(fileInfo);
}