diff --git a/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue b/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue index b166c49ce33..9abf4fa2359 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue +++ b/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue @@ -85,6 +85,7 @@ import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js' import AudioPlayer from './AudioPlayer.vue' import { useViewer } from '../../../../../composables/useViewer.js' +import { SHARED_ITEM } from '../../../../../constants.js' const PREVIEW_TYPE = { TEMPORARY: 0, @@ -233,6 +234,11 @@ export default { type: Boolean, default: false, }, + + sharedItemsType: { + type: String, + default: '', + }, }, emits: ['remove-file'], @@ -473,7 +479,18 @@ export default { event.preventDefault() const fileInfo = this.generateViewerObject(this) - this.openViewer(this.internalAbsolutePath, [fileInfo], fileInfo) + + if (this.isSharedItemsTab && this.sharedItemsType === SHARED_ITEM.TYPES.MEDIA) { + // Get available media files from store and put them to the list to navigate through slides + const mediaFiles = this.$store.getters.sharedItems(this.$store.getters.getToken())?.media + const list = Object.values(mediaFiles).reverse() + .map(item => this.generateViewerObject(item.messageParameters.file)) + + this.openViewer(this.internalAbsolutePath, list, fileInfo) + } else { + this.openViewer(this.internalAbsolutePath, [fileInfo], fileInfo) + + } }, }, } diff --git a/src/components/RightSidebar/SharedItems/SharedItems.vue b/src/components/RightSidebar/SharedItems/SharedItems.vue index 473fc02e874..23e752a7228 100644 --- a/src/components/RightSidebar/SharedItems/SharedItems.vue +++ b/src/components/RightSidebar/SharedItems/SharedItems.vue @@ -61,6 +61,7 @@ :key="item.id" :small-preview="isList" :row-layout="isList" + :shared-items-type="type" :is-shared-items-tab="true" v-bind="item.messageParameters.file" />