Skip to content

Commit

Permalink
Merge pull request #14203 from nextcloud/backport/14181/stable31
Browse files Browse the repository at this point in the history
[stable31] fix(desktop): change "reload page" messages to "restart app"
  • Loading branch information
nickvergessen authored Jan 23, 2025
2 parents 137d9db + 08eeba8 commit 9c6fef3
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/components/CallView/CallFailedDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js'
import NcModal from '@nextcloud/vue/dist/Components/NcModal.js'

import { useStore } from '../../composables/useStore.js'
import { messagePleaseTryToReload } from '../../utils/talkDesktopUtils.ts'

const store = useStore()

Expand Down Expand Up @@ -45,7 +46,7 @@ const message = computed(() => {
return connectionFailed.value.data.error
}

return t('spreed', 'Please try to reload the page')
return messagePleaseTryToReload
})

/**
Expand Down
3 changes: 2 additions & 1 deletion src/components/TopBar/CallButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ import { useSettingsStore } from '../../stores/settings.js'
import { useSoundsStore } from '../../stores/sounds.js'
import { useTalkHashStore } from '../../stores/talkHash.js'
import { blockCalls, unsupportedWarning } from '../../utils/browserCheck.ts'
import { messagePleaseReload } from '../../utils/talkDesktopUtils.ts'

export default {
name: 'CallButton',
Expand Down Expand Up @@ -288,7 +289,7 @@ export default {

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

if (this.callViewStore.callHasJustEnded) {
Expand Down
3 changes: 2 additions & 1 deletion src/composables/useHashCheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { showError, TOAST_PERMANENT_TIMEOUT } from '@nextcloud/dialogs'
import { t } from '@nextcloud/l10n'

import { useTalkHashStore } from '../stores/talkHash.js'
import { messagePleaseReload } from '../utils/talkDesktopUtils.ts'

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

showError(t('spreed', 'Nextcloud Talk was updated, please reload the page'), {
showError(t('spreed', 'Nextcloud Talk was updated.') + '\n' + messagePleaseReload, {
timeout: TOAST_PERMANENT_TIMEOUT,
})
}
Expand Down
3 changes: 2 additions & 1 deletion src/services/CapabilitiesManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getRemoteCapabilities } from './federationService.ts'
import BrowserStorage from '../services/BrowserStorage.js'
import { useTalkHashStore } from '../stores/talkHash.js'
import type { Capabilities, Conversation, JoinRoomFullResponse } from '../types/index.ts'
import { messagePleaseReload } from '../utils/talkDesktopUtils.ts'

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

// As normal capabilities update, requires a reload to take effect
showError(t('spreed', 'Nextcloud Talk Federation was updated, please reload the page'), {
showError(t('spreed', 'Nextcloud Talk Federation was updated.') + '\n' + messagePleaseReload, {
timeout: TOAST_PERMANENT_TIMEOUT,
})
}
Expand Down
3 changes: 2 additions & 1 deletion src/store/participantsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { talkBroadcastChannel } from '../services/talkBroadcastChannel.js'
import { useCallViewStore } from '../stores/callView.js'
import { useGuestNameStore } from '../stores/guestName.js'
import CancelableRequest from '../utils/cancelableRequest.js'
import { messagePleaseTryToReload } from '../utils/talkDesktopUtils.ts'

/**
* Emit global event for user status update with the status from a participant
Expand Down Expand Up @@ -1059,7 +1060,7 @@ const actions = {
EventBus.emit('forbidden-route', error.response.data.ocs.data)
} else {
console.error(error)
showError(t('spreed', 'Failed to join the conversation. Try to reload the page.'))
showError(t('spreed', 'Failed to join the conversation.') + '\n' + messagePleaseTryToReload)
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion src/stores/talkHash.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { showError, TOAST_PERMANENT_TIMEOUT } from '@nextcloud/dialogs'
import { t } from '@nextcloud/l10n'

import { talkBroadcastChannel } from '../services/talkBroadcastChannel.js'
import { messagePleaseReload } from '../utils/talkDesktopUtils.ts'

/**
* @typedef {object} State
Expand Down Expand Up @@ -87,7 +88,7 @@ export const useTalkHashStore = defineStore('talkHash', {
checkMaintenanceMode(response) {
if (response?.status === 503 && !this.maintenanceWarningToast) {
this.maintenanceWarningToast = showError(
t('spreed', 'Nextcloud is in maintenance mode, please reload the page'),
t('spreed', 'Nextcloud is in maintenance mode.') + '\n' + messagePleaseReload,
{ timeout: TOAST_PERMANENT_TIMEOUT }
)
}
Expand Down
3 changes: 2 additions & 1 deletion src/utils/signaling.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {

import CancelableRequest from './cancelableRequest.js'
import Encryption from './e2ee/encryption.js'
import { messagePleaseTryToReload } from './talkDesktopUtils.ts'
import { PARTICIPANT } from '../constants.js'
import { hasTalkFeature } from '../services/CapabilitiesManager.ts'
import { EventBus } from '../services/EventBus.ts'
Expand Down Expand Up @@ -543,7 +544,7 @@ Signaling.Internal.prototype._startPullingMessages = function() {
}

// Giving up after 5 minutes
this.pullMessageErrorToast = showError(t('spreed', 'Lost connection to signaling server. Try to reload the page manually.'), {
this.pullMessageErrorToast = showError(t('spreed', 'Lost connection to signaling server.') + '\n' + messagePleaseTryToReload, {
timeout: TOAST_PERMANENT_TIMEOUT,
})
return
Expand Down
14 changes: 14 additions & 0 deletions src/utils/talkDesktopUtils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import { t } from '@nextcloud/l10n'

export const messagePleaseReload = IS_DESKTOP
? t('spreed', 'Please restart the app.')
: t('spreed', 'Please reload the page.')

export const messagePleaseTryToReload = IS_DESKTOP
? t('spreed', 'Please try to restart the app.')
: t('spreed', 'Please try to reload the page.')

0 comments on commit 9c6fef3

Please sign in to comment.