From 1d121f85beef07854f4b91dd8c086a791550ccad Mon Sep 17 00:00:00 2001 From: SebinSong Date: Wed, 27 Nov 2024 16:42:43 +1300 Subject: [PATCH] update for Greg feedbacks --- .../chatroom/file-attachment/ChatAttachmentPreview.vue | 4 ++-- .../containers/chatroom/image-viewer/ImageViewerModal.vue | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/views/containers/chatroom/file-attachment/ChatAttachmentPreview.vue b/frontend/views/containers/chatroom/file-attachment/ChatAttachmentPreview.vue index b9dbd6447..bfbc98735 100644 --- a/frontend/views/containers/chatroom/file-attachment/ChatAttachmentPreview.vue +++ b/frontend/views/containers/chatroom/file-attachment/ChatAttachmentPreview.vue @@ -226,14 +226,14 @@ export default { id: randomHexString(12) } }) - const initialIndex = allImageAttachments.findIndex(attachment => attachment.imgUrl === objectURL) || 0 + const initialIndex = allImageAttachments.findIndex(attachment => attachment.imgUrl === objectURL) sbp( 'okTurtles.events/emit', OPEN_MODAL, 'ImageViewerModal', null, { images: allImageAttachments, - initialIndex + initialIndex: initialIndex === -1 ? 0 : initialIndex } ) } diff --git a/frontend/views/containers/chatroom/image-viewer/ImageViewerModal.vue b/frontend/views/containers/chatroom/image-viewer/ImageViewerModal.vue index 378bc1a44..461e7a83f 100644 --- a/frontend/views/containers/chatroom/image-viewer/ImageViewerModal.vue +++ b/frontend/views/containers/chatroom/image-viewer/ImageViewerModal.vue @@ -67,6 +67,7 @@ export default { }, data () { return { + touchMatchMedia: null, ephemeral: { currentIndex: 0, isTouch: false