Skip to content

Commit 37e4293

Browse files
committed
fix: pass only the total files count
1 parent 2a459dd commit 37e4293

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</div>
2525
<PreviewControls
2626
class="oc-position-absolute oc-position-bottom-center"
27-
:files="modelFiles"
27+
:total-models="modelFiles.length"
2828
:active-index="activeIndex"
2929
:is-full-screen-mode-activated="isFullScreenModeActivated"
3030
@toggle-previous="prev"
@@ -122,7 +122,7 @@ const currentModel = ref()
122122
// =====================
123123
onMounted(async () => {
124124
await loadFolderForFileContext(unref(currentFileContext))
125-
await setActiveModel(unref(currentFileContext).driveAliasAndItem)
125+
await setActiveModel(unref(currentFileContext).driveAliasAndItem as string)
126126
127127
if (unref(hasWebGLSupport)) {
128128
const { offsetWidth, offsetHeight } = unref(sceneWrapper)

src/components/PreviewControls.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@
6363
</div>
6464
</template>
6565
<script setup lang="ts">
66-
import { computed, PropType } from 'vue'
67-
import { Resource } from '@ownclouders/web-client/src'
66+
import { computed } from 'vue'
6867
6968
const toolTip = {
7069
enterFullScreenDescription: 'Enter full screen mode',
@@ -78,8 +77,8 @@ const toolTip = {
7877
// props
7978
// =====================
8079
const props = defineProps({
81-
files: {
82-
type: Array as PropType<Resource[]>,
80+
totalModels: {
81+
type: Number,
8382
required: true
8483
},
8584
activeIndex: {
@@ -101,10 +100,10 @@ defineEmits(['toggleFullScreen', 'toggleNext', 'togglePrevious', 'resetPosition'
101100
// computed properties
102101
// =====================
103102
const ariaHiddenFileCount = computed(() => {
104-
return `${(props.activeIndex + 1).toString()} of ${props.files.length.toString()}`
103+
return `${(props.activeIndex + 1).toString()} of ${props.totalModels.toString()}`
105104
})
106105
const screenreaderFileCount = computed(() => {
107-
return `3D model file ${(props.activeIndex + 1).toString()} of ${props.files.length.toString()}`
106+
return `3D model file ${(props.activeIndex + 1).toString()} of ${props.totalModels.toString()}`
108107
})
109108
</script>
110109

0 commit comments

Comments
 (0)