-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(signaling): add UI warning in group calls
Signed-off-by: Maksim Sukharev <[email protected]>
- Loading branch information
Showing
6 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<!-- | ||
- SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors | ||
- SPDX-License-Identifier: AGPL-3.0-or-later | ||
--> | ||
|
||
<script setup lang="ts"> | ||
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue' | ||
|
||
import IconNetworkStrength2Alert from 'vue-material-design-icons/NetworkStrength2Alert.vue' | ||
|
||
import { t } from '@nextcloud/l10n' | ||
|
||
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js' | ||
|
||
import { useIsInCall } from '../../composables/useIsInCall.js' | ||
import { useStore } from '../../composables/useStore.js' | ||
import { CONVERSATION } from '../../constants.js' | ||
import { EventBus } from '../../services/EventBus.ts' | ||
|
||
const store = useStore() | ||
const isInCall = useIsInCall() | ||
|
||
const isGroupConversation = computed(() => { | ||
return [CONVERSATION.TYPE.GROUP, CONVERSATION.TYPE.PUBLIC].includes(store.getters.conversation(store.getters.getToken())?.type) | ||
}) | ||
const show = ref(false) | ||
|
||
const warningDescription = t('spreed', 'Calls without High-performance backend can cause connectivity issues and high load on devices. {linkstart}Learn more{linkend}') | ||
.replace('{linkstart}', '<a target="_blank" rel="noreferrer nofollow" class="external" href="https://portal.nextcloud.com/article/Nextcloud-Talk/High-Performance-Backend/Installation-of-Nextcloud-Talk-High-Performance-Backend">') | ||
.replace('{linkend}', ' ↗</a>') | ||
|
||
onMounted(() => { | ||
EventBus.on('signaling-internal-show-warning', showInternalWarning) | ||
}) | ||
|
||
onBeforeUnmount(() => { | ||
EventBus.on('signaling-internal-show-warning', showInternalWarning) | ||
}) | ||
|
||
watch(isInCall, (value) => { | ||
if (!value) { | ||
show.value = false | ||
} | ||
}) | ||
|
||
const showInternalWarning = () => { | ||
if (isGroupConversation.value) { | ||
show.value = true | ||
} | ||
} | ||
</script> | ||
|
||
<template> | ||
<NcNoteCard v-show="show" type="warning" class="internal-warning"> | ||
<template #icon> | ||
<IconNetworkStrength2Alert fill-color="var(--color-warning)" :size="20" /> | ||
</template> | ||
<!-- eslint-disable-next-line vue/no-v-html --> | ||
<p v-html="warningDescription" /> | ||
</NcNoteCard> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.internal-warning { | ||
margin: var(--default-grid-baseline) !important; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters