Skip to content

Commit 08eeba8

Browse files
ShGKmebackportbot[bot]
authored andcommitted
fix(desktop): change "reload page" messages to "restart app"
Signed-off-by: Grigorii K. Shartsev <[email protected]>
1 parent 137d9db commit 08eeba8

File tree

8 files changed

+28
-7
lines changed

8 files changed

+28
-7
lines changed

src/components/CallView/CallFailedDialog.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js'
1414
import NcModal from '@nextcloud/vue/dist/Components/NcModal.js'
1515

1616
import { useStore } from '../../composables/useStore.js'
17+
import { messagePleaseTryToReload } from '../../utils/talkDesktopUtils.ts'
1718

1819
const store = useStore()
1920

@@ -45,7 +46,7 @@ const message = computed(() => {
4546
return connectionFailed.value.data.error
4647
}
4748

48-
return t('spreed', 'Please try to reload the page')
49+
return messagePleaseTryToReload
4950
})
5051

5152
/**

src/components/TopBar/CallButton.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ import { useSettingsStore } from '../../stores/settings.js'
115115
import { useSoundsStore } from '../../stores/sounds.js'
116116
import { useTalkHashStore } from '../../stores/talkHash.js'
117117
import { blockCalls, unsupportedWarning } from '../../utils/browserCheck.ts'
118+
import { messagePleaseReload } from '../../utils/talkDesktopUtils.ts'
118119

119120
export default {
120121
name: 'CallButton',
@@ -288,7 +289,7 @@ export default {
288289

289290
startCallTitle() {
290291
if (this.isNextcloudTalkHashDirty) {
291-
return t('spreed', 'Nextcloud Talk was updated, you need to reload the page before you can start or join a call.')
292+
return t('spreed', 'Nextcloud Talk was updated, you cannot start or join a call.') + ' ' + messagePleaseReload
292293
}
293294

294295
if (this.callViewStore.callHasJustEnded) {

src/composables/useHashCheck.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { showError, TOAST_PERMANENT_TIMEOUT } from '@nextcloud/dialogs'
99
import { t } from '@nextcloud/l10n'
1010

1111
import { useTalkHashStore } from '../stores/talkHash.js'
12+
import { messagePleaseReload } from '../utils/talkDesktopUtils.ts'
1213

1314
/**
1415
* Check whether the conflicting session detected or not, and navigate to another page
@@ -31,7 +32,7 @@ export function useHashCheck() {
3132
const showReloadWarning = () => {
3233
reloadWarningShown = true
3334

34-
showError(t('spreed', 'Nextcloud Talk was updated, please reload the page'), {
35+
showError(t('spreed', 'Nextcloud Talk was updated.') + '\n' + messagePleaseReload, {
3536
timeout: TOAST_PERMANENT_TIMEOUT,
3637
})
3738
}

src/services/CapabilitiesManager.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { getRemoteCapabilities } from './federationService.ts'
1111
import BrowserStorage from '../services/BrowserStorage.js'
1212
import { useTalkHashStore } from '../stores/talkHash.js'
1313
import type { Capabilities, Conversation, JoinRoomFullResponse } from '../types/index.ts'
14+
import { messagePleaseReload } from '../utils/talkDesktopUtils.ts'
1415

1516
type Config = Capabilities['spreed']['config']
1617
type RemoteCapability = Capabilities & Partial<{ hash: string }>
@@ -136,7 +137,7 @@ export async function setRemoteCapabilities(joinRoomResponse: JoinRoomFullRespon
136137
patchTokenMap(joinRoomResponse.data.ocs.data)
137138

138139
// As normal capabilities update, requires a reload to take effect
139-
showError(t('spreed', 'Nextcloud Talk Federation was updated, please reload the page'), {
140+
showError(t('spreed', 'Nextcloud Talk Federation was updated.') + '\n' + messagePleaseReload, {
140141
timeout: TOAST_PERMANENT_TIMEOUT,
141142
})
142143
}

src/store/participantsStore.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import { talkBroadcastChannel } from '../services/talkBroadcastChannel.js'
3939
import { useCallViewStore } from '../stores/callView.js'
4040
import { useGuestNameStore } from '../stores/guestName.js'
4141
import CancelableRequest from '../utils/cancelableRequest.js'
42+
import { messagePleaseTryToReload } from '../utils/talkDesktopUtils.ts'
4243

4344
/**
4445
* Emit global event for user status update with the status from a participant
@@ -1059,7 +1060,7 @@ const actions = {
10591060
EventBus.emit('forbidden-route', error.response.data.ocs.data)
10601061
} else {
10611062
console.error(error)
1062-
showError(t('spreed', 'Failed to join the conversation. Try to reload the page.'))
1063+
showError(t('spreed', 'Failed to join the conversation.') + '\n' + messagePleaseTryToReload)
10631064
}
10641065
}
10651066
},

src/stores/talkHash.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { showError, TOAST_PERMANENT_TIMEOUT } from '@nextcloud/dialogs'
1010
import { t } from '@nextcloud/l10n'
1111

1212
import { talkBroadcastChannel } from '../services/talkBroadcastChannel.js'
13+
import { messagePleaseReload } from '../utils/talkDesktopUtils.ts'
1314

1415
/**
1516
* @typedef {object} State
@@ -87,7 +88,7 @@ export const useTalkHashStore = defineStore('talkHash', {
8788
checkMaintenanceMode(response) {
8889
if (response?.status === 503 && !this.maintenanceWarningToast) {
8990
this.maintenanceWarningToast = showError(
90-
t('spreed', 'Nextcloud is in maintenance mode, please reload the page'),
91+
t('spreed', 'Nextcloud is in maintenance mode.') + '\n' + messagePleaseReload,
9192
{ timeout: TOAST_PERMANENT_TIMEOUT }
9293
)
9394
}

src/utils/signaling.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616

1717
import CancelableRequest from './cancelableRequest.js'
1818
import Encryption from './e2ee/encryption.js'
19+
import { messagePleaseTryToReload } from './talkDesktopUtils.ts'
1920
import { PARTICIPANT } from '../constants.js'
2021
import { hasTalkFeature } from '../services/CapabilitiesManager.ts'
2122
import { EventBus } from '../services/EventBus.ts'
@@ -543,7 +544,7 @@ Signaling.Internal.prototype._startPullingMessages = function() {
543544
}
544545

545546
// Giving up after 5 minutes
546-
this.pullMessageErrorToast = showError(t('spreed', 'Lost connection to signaling server. Try to reload the page manually.'), {
547+
this.pullMessageErrorToast = showError(t('spreed', 'Lost connection to signaling server.') + '\n' + messagePleaseTryToReload, {
547548
timeout: TOAST_PERMANENT_TIMEOUT,
548549
})
549550
return

src/utils/talkDesktopUtils.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
3+
* SPDX-License-Identifier: AGPL-3.0-or-later
4+
*/
5+
6+
import { t } from '@nextcloud/l10n'
7+
8+
export const messagePleaseReload = IS_DESKTOP
9+
? t('spreed', 'Please restart the app.')
10+
: t('spreed', 'Please reload the page.')
11+
12+
export const messagePleaseTryToReload = IS_DESKTOP
13+
? t('spreed', 'Please try to restart the app.')
14+
: t('spreed', 'Please try to reload the page.')

0 commit comments

Comments
 (0)