diff options
author | Grigorii Shartsev <grigorii.shartsev@nextcloud.com> | 2023-05-03 17:59:25 +0200 |
---|---|---|
committer | Grigorii Shartsev <grigorii.shartsev@nextcloud.com> | 2023-05-03 19:42:55 +0200 |
commit | c9a8dfe0363feea8612f01f65a5692386b2d4a5d (patch) | |
tree | daf53def165593e1edabf1c59750ef0c67d40b9d /src/mixins/isInCall.js | |
parent | 4890b3a6f79eb41b2f822999565fd60dd608af51 (diff) |
refactor(frontend): make openViewer and isInCall mixins composables
Signed-off-by: Grigorii Shartsev <grigorii.shartsev@nextcloud.com>
Diffstat (limited to 'src/mixins/isInCall.js')
-rw-r--r-- | src/mixins/isInCall.js | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/src/mixins/isInCall.js b/src/mixins/isInCall.js deleted file mode 100644 index 2f4508632..000000000 --- a/src/mixins/isInCall.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * - * @copyright Copyright (c) 2020 Joas Schilling <coding@schilljs.com> - * - * @license AGPL-3.0-or-later - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ - -import { EventBus } from '../services/EventBus.js' -import SessionStorage from '../services/SessionStorage.js' - -/** - * A mixin to check whether the user joined the call of the current token in this PHP session or not. - */ -export default { - - data() { - return { - sessionStorageJoinedConversation: null, - } - }, - - computed: { - isInCall() { - return this.$store.getters.forceCallView - || (this.sessionStorageJoinedConversation === this.$store.getters.getToken() - && this.$store.getters.isInCall(this.$store.getters.getToken())) - }, - }, - - beforeDestroy() { - EventBus.$off('joined-conversation', this.readSessionStorageJoinedConversation) - }, - - beforeMount() { - EventBus.$on('joined-conversation', this.readSessionStorageJoinedConversation) - this.sessionStorageJoinedConversation = SessionStorage.getItem('joined_conversation') - }, - - methods: { - readSessionStorageJoinedConversation() { - this.sessionStorageJoinedConversation = SessionStorage.getItem('joined_conversation') - }, - }, -} |