Fix drive browser showing false empty (#5127)

This commit is contained in:
Satsuki Yanagi 2019-07-09 17:38:14 +09:00 committed by syuilo
parent 8ca4d39440
commit a59ab79da0
2 changed files with 6 additions and 6 deletions

View File

@ -22,19 +22,19 @@
> >
<div class="selection" ref="selection"></div> <div class="selection" ref="selection"></div>
<div class="contents" ref="contents"> <div class="contents" ref="contents">
<div class="folders" ref="foldersContainer" v-if="folders.length > 0"> <div class="folders" ref="foldersContainer" v-if="folders.length > 0 || moreFolders">
<x-folder v-for="folder in folders" :key="folder.id" class="folder" :folder="folder"/> <x-folder v-for="folder in folders" :key="folder.id" class="folder" :folder="folder"/>
<!-- SEE: https://stackoverflow.com/questions/18744164/flex-box-align-last-row-to-grid --> <!-- SEE: https://stackoverflow.com/questions/18744164/flex-box-align-last-row-to-grid -->
<div class="padding" v-for="n in 16"></div> <div class="padding" v-for="n in 16"></div>
<ui-button v-if="moreFolders">{{ $t('@.load-more') }}</ui-button> <ui-button v-if="moreFolders">{{ $t('@.load-more') }}</ui-button>
</div> </div>
<div class="files" ref="filesContainer" v-if="files.length > 0"> <div class="files" ref="filesContainer" v-if="files.length > 0 || moreFiles">
<x-file v-for="file in files" :key="file.id" class="file" :file="file"/> <x-file v-for="file in files" :key="file.id" class="file" :file="file"/>
<!-- SEE: https://stackoverflow.com/questions/18744164/flex-box-align-last-row-to-grid --> <!-- SEE: https://stackoverflow.com/questions/18744164/flex-box-align-last-row-to-grid -->
<div class="padding" v-for="n in 16"></div> <div class="padding" v-for="n in 16"></div>
<ui-button v-if="moreFiles" @click="fetchMoreFiles">{{ $t('@.load-more') }}</ui-button> <ui-button v-if="moreFiles" @click="fetchMoreFiles">{{ $t('@.load-more') }}</ui-button>
</div> </div>
<div class="empty" v-if="files.length == 0 && folders.length == 0 && !fetching"> <div class="empty" v-if="files.length == 0 && !moreFiles && folders.length == 0 && !moreFolders && !fetching">
<p v-if="draghover">{{ $t('empty-draghover') }}</p> <p v-if="draghover">{{ $t('empty-draghover') }}</p>
<p v-if="!draghover && folder == null"><strong>{{ $t('empty-drive') }}</strong><br/>{{ $t('empty-drive-description') }}</p> <p v-if="!draghover && folder == null"><strong>{{ $t('empty-drive') }}</strong><br/>{{ $t('empty-drive-description') }}</p>
<p v-if="!draghover && folder != null">{{ $t('empty-folder') }}</p> <p v-if="!draghover && folder != null">{{ $t('empty-folder') }}</p>

View File

@ -25,17 +25,17 @@
<template v-if="folder.filesCount > 0">{{ folder.filesCount }} {{ $t('file-count') }}</template> <template v-if="folder.filesCount > 0">{{ folder.filesCount }} {{ $t('file-count') }}</template>
</p> </p>
</div> </div>
<div class="folders" v-if="folders.length > 0"> <div class="folders" v-if="folders.length > 0 || moreFolders">
<x-folder class="folder" v-for="folder in folders" :key="folder.id" :folder="folder"/> <x-folder class="folder" v-for="folder in folders" :key="folder.id" :folder="folder"/>
<p v-if="moreFolders">{{ $t('@.load-more') }}</p> <p v-if="moreFolders">{{ $t('@.load-more') }}</p>
</div> </div>
<div class="files" v-if="files.length > 0"> <div class="files" v-if="files.length > 0 || moreFiles">
<x-file class="file" v-for="file in files" :key="file.id" :file="file"/> <x-file class="file" v-for="file in files" :key="file.id" :file="file"/>
<button class="more" v-if="moreFiles" @click="fetchMoreFiles"> <button class="more" v-if="moreFiles" @click="fetchMoreFiles">
{{ fetchingMoreFiles ? this.$t('@.loading') : this.$t('@.load-more') }} {{ fetchingMoreFiles ? this.$t('@.loading') : this.$t('@.load-more') }}
</button> </button>
</div> </div>
<div class="empty" v-if="files.length == 0 && folders.length == 0 && !fetching"> <div class="empty" v-if="files.length == 0 && !moreFiles && folders.length == 0 && !moreFolders && !fetching">
<p v-if="folder == null">{{ $t('nothing-in-drive') }}</p> <p v-if="folder == null">{{ $t('nothing-in-drive') }}</p>
<p v-if="folder != null">{{ $t('folder-is-empty') }}</p> <p v-if="folder != null">{{ $t('folder-is-empty') }}</p>
</div> </div>