Skip to content

Commit

Permalink
fix(files): Keep 'back'-button for not found directories or if user c…
Browse files Browse the repository at this point in the history
…an not upload

Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed May 29, 2024
1 parent 1526a6f commit 1463592
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
20 changes: 17 additions & 3 deletions apps/files/src/views/FilesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,21 @@
:name="currentView?.emptyTitle || t('files', 'No files in here')"
:description="currentView?.emptyCaption || t('files', 'Upload some content or sync with your devices!')"
data-cy-files-content-empty>
<template #action>
<template v-if="dir !== '/'" #action>
<!-- Uploader -->
<UploadPicker v-if="dir !== '/'"
<UploadPicker v-if="currentFolder && canUpload && !isQuotaExceeded"
:content="dirContents"
:destination="currentFolder"
:multiple="true"
class="files-list__header-upload-button"
multiple
@failed="onUploadFail"
@uploaded="onUpload" />
<NcButton v-else
:aria-label="t('files', 'Go to the previous folder')"
:to="toPreviousDir"
type="primary">
{{ t('files', 'Go back') }}
</NcButton>
</template>
<template #icon>
<NcIconSvgWrapper :svg="currentView.icon" />
Expand Down Expand Up @@ -353,6 +359,14 @@ export default defineComponent({
&& this.loading
},

/**
* Route to the previous directory.
*/
toPreviousDir(): Route {
const dir = this.dir.split('/').slice(0, -1).join('/') || '/'
return { ...this.$route, query: { dir } }
},

shareAttributes(): number[] | undefined {
if (!this.currentFolder?.attributes?.['share-types']) {
return undefined
Expand Down
6 changes: 3 additions & 3 deletions dist/files-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-main.js.map

Large diffs are not rendered by default.

0 comments on commit 1463592

Please sign in to comment.