diff options
Diffstat (limited to 'apps/files/src/components/FileEntry.vue')
-rw-r--r-- | apps/files/src/components/FileEntry.vue | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/apps/files/src/components/FileEntry.vue b/apps/files/src/components/FileEntry.vue index 0ee04739282..847decd4378 100644 --- a/apps/files/src/components/FileEntry.vue +++ b/apps/files/src/components/FileEntry.vue @@ -86,9 +86,10 @@ <script lang="ts"> import { defineComponent } from 'vue' -import { Permission, formatFileSize } from '@nextcloud/files' +import { formatFileSize } from '@nextcloud/files' import moment from '@nextcloud/moment' +import { useNavigation } from '../composables/useNavigation' import { useActionsMenuStore } from '../store/actionsmenu.ts' import { useDragAndDropStore } from '../store/dragging.ts' import { useFilesStore } from '../store/files.ts' @@ -140,12 +141,16 @@ export default defineComponent({ const filesStore = useFilesStore() const renamingStore = useRenamingStore() const selectionStore = useSelectionStore() + const { currentView } = useNavigation() + return { actionsMenuStore, draggingStore, filesStore, renamingStore, selectionStore, + + currentView, } }, @@ -179,21 +184,22 @@ export default defineComponent({ }, size() { - const size = parseInt(this.source.size, 10) - if (typeof size !== 'number' || isNaN(size) || size < 0) { + const size = this.source.size + if (!size || size < 0) { return this.t('files', 'Pending') } return formatFileSize(size, true) }, + sizeOpacity() { const maxOpacitySize = 10 * 1024 * 1024 - const size = parseInt(this.source.size, 10) + const size = this.source.size if (!size || isNaN(size) || size < 0) { return {} } - const ratio = Math.round(Math.min(100, 100 * Math.pow((this.source.size / maxOpacitySize), 2))) + const ratio = Math.round(Math.min(100, 100 * Math.pow((size / maxOpacitySize), 2))) return { color: `color-mix(in srgb, var(--color-main-text) ${ratio}%, var(--color-text-maxcontrast))`, } |