mirror of https://github.com/keeweb/keeweb.git
bugfixes
This commit is contained in:
parent
2d5fb037fd
commit
1227698aeb
|
@ -22,7 +22,7 @@ var FileInfoCollection = Backbone.Collection.extend({
|
|||
},
|
||||
|
||||
getLast: function () {
|
||||
this.max(function(file) { return file.get('openDate'); });
|
||||
return this.first();
|
||||
},
|
||||
|
||||
getMatch: function (storage, name, path) {
|
||||
|
|
|
@ -302,8 +302,8 @@ var AppModel = Backbone.Model.extend({
|
|||
if (that.files.get(file.id)) {
|
||||
return callback('Duplicate file id');
|
||||
}
|
||||
var cacheId = fileInfo && fileInfo.id || IdGenerator.uuid();
|
||||
if (params.availOffline && updateCacheOnSuccess) {
|
||||
var cacheId = fileInfo && fileInfo.id || IdGenerator.uuid();
|
||||
Storage.cache.save(cacheId, params.fileData, function(err) {
|
||||
if (err) {
|
||||
file.set('availOffline', false);
|
||||
|
@ -315,6 +315,9 @@ var AppModel = Backbone.Model.extend({
|
|||
if (!params.availOffline && fileInfo && !fileInfo.get('modified')) {
|
||||
that.removeFileInfo(fileInfo.id);
|
||||
}
|
||||
if (params.storage === 'file') {
|
||||
that.addToLastOpenFiles(file, cacheId, params.rev);
|
||||
}
|
||||
that.addFile(file);
|
||||
});
|
||||
},
|
||||
|
|
|
@ -65,7 +65,10 @@ var StorageFileCache = {
|
|||
return callback && callback(err);
|
||||
}
|
||||
try {
|
||||
Launcher.deleteFile(this.getPath(id));
|
||||
var path = this.getPath(id);
|
||||
if (Launcher.fileExists(path)) {
|
||||
Launcher.deleteFile(path);
|
||||
}
|
||||
if (callback) { callback(); }
|
||||
} catch(e) {
|
||||
console.error('Error removing from cache', id, e);
|
||||
|
|
|
@ -59,7 +59,7 @@ var OpenView = Backbone.View.extend({
|
|||
getLastOpenFiles: function() {
|
||||
return this.model.fileInfos.map(function(f) {
|
||||
var icon;
|
||||
switch (f.storage) {
|
||||
switch (f.get('storage')) {
|
||||
case 'dropbox':
|
||||
icon = 'dropbox';
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue