Skip to content

Commit 31cf823

Browse files
committed
fix(CallFailedDialog): expose reload function
Signed-off-by: Maksim Sukharev <[email protected]>
1 parent 4ae65f2 commit 31cf823

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

src/components/CallView/CallFailedDialog.vue

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
import { t } from '@nextcloud/l10n'
88
import { computed } from 'vue'
99
import { useStore } from 'vuex'
10+
import NcButton from '@nextcloud/vue/components/NcButton'
1011
import NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'
1112
import NcModal from '@nextcloud/vue/components/NcModal'
1213
import IconAlertOctagonOutline from 'vue-material-design-icons/AlertOctagonOutline.vue'
13-
import { messagePleaseTryToReload } from '../../utils/talkDesktopUtils.ts'
14+
import IconRefresh from 'vue-material-design-icons/Refresh.vue'
15+
import { messagePleaseTryToReload, messageReload } from '../../utils/talkDesktopUtils.ts'
1416
1517
const props = defineProps({
1618
token: {
@@ -46,12 +48,19 @@ const message = computed(() => {
4648
})
4749
4850
/**
49-
*
51+
* Reset error status in the store
5052
*/
5153
function clearConnectionFailedError() {
5254
store.dispatch('clearConnectionFailed', props.token)
5355
}
5456
57+
/**
58+
* Reload the page to get a valid room object and HPB settings
59+
*/
60+
function reloadApp() {
61+
window.location.reload()
62+
}
63+
5564
</script>
5665

5766
<template>
@@ -64,6 +73,16 @@ function clearConnectionFailedError() {
6473
<template #icon>
6574
<IconAlertOctagonOutline />
6675
</template>
76+
<template #action>
77+
<NcButton
78+
variant="primary"
79+
@click="reloadApp">
80+
<template #icon>
81+
<IconRefresh />
82+
</template>
83+
{{ messageReload }}
84+
</NcButton>
85+
</template>
6786
</NcEmptyContent>
6887
</NcModal>
6988
</template>

src/utils/talkDesktopUtils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ export const messagePleaseReload = IS_DESKTOP
1212
export const messagePleaseTryToReload = IS_DESKTOP
1313
? t('spreed', 'Please try to restart the app.')
1414
: t('spreed', 'Please try to reload the page.')
15+
16+
export const messageReload = IS_DESKTOP
17+
? t('spreed', 'Restart')
18+
: t('spreed', 'Reload')

0 commit comments

Comments
 (0)