fixed google drive files listing

This commit is contained in:
antelle 2017-12-04 19:30:55 +01:00
parent b6d507d5bc
commit 40c3b0b5bd
2 changed files with 5 additions and 6 deletions

View File

@ -19,15 +19,14 @@ const StorageFileListView = Backbone.View.extend({
this.allStorageFiles[file.path] = file;
return {
path: file.path,
name: UrlUtil.getDataFileName(file.name),
name: file.name.replace(/\.kdbx$/i, ''),
kdbx: UrlUtil.isKdbx(file.name),
dir: file.dir
};
});
let hasHiddenFiles = this.showHiddenFiles;
const visibleFiles = files.filter(f => !f.dir && f.kdbx);
const canShowHiddenFiles = visibleFiles.length && files.length > visibleFiles.length;
if (!this.showHiddenFiles) {
const visibleFiles = files.filter(f => !f.dir && f.kdbx);
hasHiddenFiles = files.length > visibleFiles.length;
if (visibleFiles.length > 0) {
files = visibleFiles;
} else {
@ -39,7 +38,7 @@ const StorageFileListView = Backbone.View.extend({
files,
density,
showHiddenFiles: this.showHiddenFiles,
hasHiddenFiles: hasHiddenFiles
canShowHiddenFiles: canShowHiddenFiles
});
return this;
},

View File

@ -23,7 +23,7 @@
</div>
</div>
</div>
{{#if hasHiddenFiles}}
{{#if canShowHiddenFiles}}
<div class="open-list__check-wrap">
<input type="checkbox" id="open-list__check" {{#if showHiddenFiles}}checked{{/if}}
/><label class="open-list__check-label" for="open-list__check">{{res 'openShowAllFiles'}}</label>