Skip to content

Commit

Permalink
feat: hide breadcrumbs when an upload is ongoing on narrow screen #40942
Browse files Browse the repository at this point in the history


Signed-off-by: Andrii Rublov <airublev@outlook.com>
  • Loading branch information
Andrii Rublov authored and skjnldsv committed Apr 4, 2024
1 parent 233e863 commit 1a845dd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions apps/files/src/components/BreadCrumbs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
:aria-label="t('files', 'Current directory path')">
<!-- Current path sections -->
<NcBreadcrumb v-for="(section, index) in sections"
v-show="shouldShowBreadcrumbs"
:key="section.dir"
v-bind="section"
dir="auto"
Expand Down Expand Up @@ -45,6 +46,7 @@ import { useDragAndDropStore } from '../store/dragging.ts'
import { useFilesStore } from '../store/files.ts'
import { usePathsStore } from '../store/paths.ts'
import { useSelectionStore } from '../store/selection.ts'
import { useUploaderStore } from '../store/uploader.ts'
import filesListWidthMixin from '../mixins/filesListWidth.ts'
import logger from '../logger'
Expand Down Expand Up @@ -73,11 +75,14 @@ export default defineComponent({
const filesStore = useFilesStore()
const pathsStore = usePathsStore()
const selectionStore = useSelectionStore()
const uploaderStore = useUploaderStore()
return {
draggingStore,
filesStore,
pathsStore,
selectionStore,
uploaderStore,
}
},
Expand Down Expand Up @@ -114,6 +119,21 @@ export default defineComponent({
return this.currentView?.icon ?? HomeSvg
},
isUploadInProgress(): boolean {
return this.uploaderStore.queue.length !== 0
},
// Hide breadcrumbs if an upload is ongoing
shouldShowBreadcrumbs(): boolean {
// If we're uploading files, only show the breadcrumbs
// if the files list is greater than 768px wide
if (this.isUploadInProgress) {
return this.filesListWidth > 768
}
// If we're not uploading, we have enough space from 400px
return this.filesListWidth > 400
},
selectedFiles() {
return this.selectionStore.selected
},
Expand Down

0 comments on commit 1a845dd

Please sign in to comment.