Move media_viewer module to store

This commit is contained in:
Sean King 2023-04-05 13:55:38 -06:00
commit c25cfe540b
No known key found for this signature in database
GPG key ID: 510C52BACD6E7257
8 changed files with 49 additions and 56 deletions

View file

@ -1,3 +1,4 @@
import { useMediaViewerStore } from '../../stores/media_viewer'
import Attachment from '../attachment/attachment.vue'
import { sumBy, set } from 'lodash'
@ -107,11 +108,11 @@ const Gallery = {
this.hidingLong = event
},
openGallery () {
this.$store.dispatch('setMedia', this.attachments)
this.$store.dispatch('setCurrentMedia', this.attachments[0])
useMediaViewerStore().setMedia(this.attachments)
useMediaViewerStore().setCurrentMedia(this.attachments[0])
},
onMedia () {
this.$store.dispatch('setMedia', this.attachments)
useMediaViewerStore().setMedia(this.attachments)
}
}
}