This commit is contained in:
Antelle 2015-12-14 00:18:02 +03:00
parent 2f86ff8502
commit 06e4743650
2 changed files with 2 additions and 1 deletions

View File

@ -298,7 +298,7 @@ var AppModel = Backbone.Model.extend({
logger.info('Stat file');
storage.stat(params.path, function(err, stat) {
if (fileInfo && (err || stat && stat.rev === cacheRev)) {
logger.info('Open file from cache because it is latest or stat error', err);
logger.info('Open file from cache because ' + (err ? 'stat error' : 'it is latest'), err);
that.openFileFromCache(params, callback, fileInfo);
} else if (stat) {
logger.info('Open file from storage');

View File

@ -332,6 +332,7 @@ var AppView = Backbone.View.extend({
return;
}
this.model.syncFile(file, null, fileSaved.bind(this, file));
pendingCallbacks++;
}, this);
if (!pendingCallbacks) {
this.closeAllFilesAndShowFirst();