diff options
author | Grigorii Shartsev <grigorii.shartsev@nextcloud.com> | 2023-05-02 10:27:44 +0200 |
---|---|---|
committer | Grigorii Shartsev <grigorii.shartsev@nextcloud.com> | 2023-05-02 16:57:50 +0200 |
commit | d586f9a261caa14d839ab570baef5533b6a7ce50 (patch) | |
tree | 2ea544400c77af8ccea89d84a4e9ddc1ca2beda9 | |
parent | abdd3db11df0d50b47a4d60fd1d5af0e4bfbcd1a (diff) |
Change isViewerOverlay callView state on Viewer toggle
Signed-off-by: Grigorii Shartsev <grigorii.shartsev@nextcloud.com>
-rw-r--r-- | src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue | 12 | ||||
-rw-r--r-- | src/components/NewMessageForm/NewMessageForm.vue | 11 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue b/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue index 66dd9c5e5..36cc2637d 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue +++ b/src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue @@ -4,6 +4,7 @@ - - @author Joas Schilling <coding@schilljs.com> - @author Marco Ambrosini <marcoambrosini@icloud.com> + - @author Grigorii Shartsev <me@shgk.me> - - @license GNU AGPL version 3 or any later version - @@ -83,6 +84,8 @@ import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js' import AudioPlayer from './AudioPlayer.vue' +import isInCall from '../../../../../mixins/isInCall.js' + const PREVIEW_TYPE = { TEMPORARY: 0, MIME_ICON: 1, @@ -104,6 +107,8 @@ export default { tooltip: Tooltip, }, + mixins: [isInCall], + props: { /** * File id @@ -486,6 +491,10 @@ export default { } } + if (this.isInCall) { + this.$store.dispatch('setCallViewMode', { isViewerOverlay: true }) + } + OCA.Viewer.open({ // Viewer expects an internal absolute path starting with "/". path: this.internalAbsolutePath, @@ -500,6 +509,9 @@ export default { permissions, }, ], + onClose: () => { + this.$store.dispatch('setCallViewMode', { isViewerOverlay: false }) + }, }) // FIXME Remove this hack once it is possible to set the parent diff --git a/src/components/NewMessageForm/NewMessageForm.vue b/src/components/NewMessageForm/NewMessageForm.vue index 837c9013a..12b40f6bb 100644 --- a/src/components/NewMessageForm/NewMessageForm.vue +++ b/src/components/NewMessageForm/NewMessageForm.vue @@ -2,6 +2,7 @@ - @copyright Copyright (c) 2019 Marco Ambrosini <marcoambrosini@icloud.com> - - @author Marco Ambrosini <marcoambrosini@icloud.com> + - @author Grigorii Shartsev <me@shgk.me> - - @license GNU AGPL version 3 or any later version - @@ -247,6 +248,7 @@ import SimplePollsEditor from './SimplePollsEditor/SimplePollsEditor.vue' import TemplatePreview from './TemplatePreview.vue' import { CONVERSATION, PARTICIPANT } from '../../constants.js' +import isInCall from '../../mixins/isInCall.js' import { EventBus } from '../../services/EventBus.js' import { shareFile, createTextFile } from '../../services/filesSharingServices.js' import { searchPossibleMentions } from '../../services/mentionsService.js' @@ -291,6 +293,8 @@ export default { NcTextField, }, + mixins: [isInCall], + props: { /** * The current conversation token or the breakout room token. @@ -812,12 +816,19 @@ export default { OCA.Files.Sidebar.state.file = filePath } + if (this.isInCall) { + this.$store.dispatch('setCallViewMode', { isViewerOverlay: true }) + } + OCA.Viewer.open({ // Viewer expects an internal absolute path starting with "/". path: filePath, list: [ fileData, ], + onClose: () => { + this.$store.dispatch('setCallViewMode', { isViewerOverlay: false }) + }, }) // FIXME Remove this hack once it is possible to set the parent |