diff options
author | Joas Schilling <coding@schilljs.com> | 2020-10-12 11:54:33 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-10-12 11:54:33 +0300 |
commit | 4212258b13a73e492e73e4fd1cb1e6c253eb31fb (patch) | |
tree | 8ed20085c6b970ff89244c20800f64a57a86d90c /src | |
parent | a9a84655b5c4c0975a56ead9c2e426abdbfcae02 (diff) |
Use defined constants
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/CallView/shared/LocalVideo.vue | 8 | ||||
-rw-r--r-- | src/mixins/browserCheck.js | 4 | ||||
-rw-r--r-- | src/mixins/talkHashCheck.js | 4 | ||||
-rw-r--r-- | src/services/conversationsService.js | 6 | ||||
-rw-r--r-- | src/utils/signaling.js | 13 | ||||
-rw-r--r-- | src/utils/webrtc/webrtc.js | 11 |
6 files changed, 26 insertions, 20 deletions
diff --git a/src/components/CallView/shared/LocalVideo.vue b/src/components/CallView/shared/LocalVideo.vue index c6b1c8696..8adab864e 100644 --- a/src/components/CallView/shared/LocalVideo.vue +++ b/src/components/CallView/shared/LocalVideo.vue @@ -69,7 +69,11 @@ import Avatar from '@nextcloud/vue/dist/Components/Avatar' import LocalMediaControls from './LocalMediaControls' import Hex from 'crypto-js/enc-hex' import SHA1 from 'crypto-js/sha1' -import { showInfo, showError } from '@nextcloud/dialogs' +import { + showError, + showInfo, + TOAST_PERMANENT_TIMEOUT, +} from '@nextcloud/dialogs' import video from '../../../mixins/video.js' import VideoBackground from './VideoBackground' import { callAnalyzer } from '../../../utils/webrtc/index' @@ -291,7 +295,7 @@ export default { handler: function(localStreamVideoError) { if (localStreamVideoError) { showError(t('spreed', 'Error while accessing camera'), { - timeout: -1, + timeout: TOAST_PERMANENT_TIMEOUT, }) } }, diff --git a/src/mixins/browserCheck.js b/src/mixins/browserCheck.js index d5b00d1c0..b8bd41bb6 100644 --- a/src/mixins/browserCheck.js +++ b/src/mixins/browserCheck.js @@ -20,7 +20,7 @@ * */ -import { showError } from '@nextcloud/dialogs' +import { showError, TOAST_PERMANENT_TIMEOUT } from '@nextcloud/dialogs' import UAParser from 'ua-parser-js' const browserCheck = { @@ -31,7 +31,7 @@ const browserCheck = { showError( this.unsupportedWarning, { - timeout: -1, + timeout: TOAST_PERMANENT_TIMEOUT, }) } }, diff --git a/src/mixins/talkHashCheck.js b/src/mixins/talkHashCheck.js index 71bde1860..d2a9fcb3b 100644 --- a/src/mixins/talkHashCheck.js +++ b/src/mixins/talkHashCheck.js @@ -20,7 +20,7 @@ * */ -import { showError } from '@nextcloud/dialogs' +import { showError, TOAST_PERMANENT_TIMEOUT } from '@nextcloud/dialogs' const talkHashCheck = { data() { @@ -51,7 +51,7 @@ const talkHashCheck = { this.reloadWarningShown = true showError(t('spreed', 'Nextcloud Talk was updated, please reload the page'), { - timeout: -1, + timeout: TOAST_PERMANENT_TIMEOUT, }) }, }, diff --git a/src/services/conversationsService.js b/src/services/conversationsService.js index af11a70a6..fcb827aab 100644 --- a/src/services/conversationsService.js +++ b/src/services/conversationsService.js @@ -23,7 +23,7 @@ import axios from '@nextcloud/axios' import { generateOcsUrl } from '@nextcloud/router' import { CONVERSATION, SHARE } from '../constants' -import { showError } from '@nextcloud/dialogs' +import { showError, TOAST_PERMANENT_TIMEOUT } from '@nextcloud/dialogs' import store from '../store/index' let maintenanceWarning = null @@ -46,7 +46,7 @@ const fetchConversations = async function() { } catch (error) { if (error.response && error.response.status === 503 && !maintenanceWarning) { maintenanceWarning = showError(t('spreed', 'Nextcloud is in maintenance mode, please reload the page'), { - timeout: -1, + timeout: TOAST_PERMANENT_TIMEOUT, }) } throw error @@ -72,7 +72,7 @@ const fetchConversation = async function(token) { } catch (error) { if (error.response && error.response.status === 503 && !maintenanceWarning) { maintenanceWarning = showError(t('spreed', 'Nextcloud is in maintenance mode, please reload the page'), { - timeout: -1, + timeout: TOAST_PERMANENT_TIMEOUT, }) } throw error diff --git a/src/utils/signaling.js b/src/utils/signaling.js index 94a97266d..1b0af2b75 100644 --- a/src/utils/signaling.js +++ b/src/utils/signaling.js @@ -38,6 +38,7 @@ import { import { showError, showWarning, + TOAST_PERMANENT_TIMEOUT, } from '@nextcloud/dialogs' const Signaling = { @@ -356,9 +357,7 @@ Signaling.Internal.prototype._sendMessageWithCallback = function(ev) { }.bind(this)) .catch(function(err) { console.error(err) - showError(t('spreed', 'Sending signaling message has failed.'), { - timeout: 15, - }) + showError(t('spreed', 'Sending signaling message has failed.')) }) } @@ -453,7 +452,7 @@ Signaling.Internal.prototype._startPullingMessages = function() { } else if (token) { if (this.pullMessagesFails === 1) { this.pullMessageErrorToast = showError(t('spreed', 'Lost connection to signaling server. Trying to reconnect.'), { - timeout: -1, + timeout: TOAST_PERMANENT_TIMEOUT, }) } if (this.pullMessagesFails === 30) { @@ -463,7 +462,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.'), { - timeout: -1, + timeout: TOAST_PERMANENT_TIMEOUT, }) return } @@ -558,7 +557,7 @@ Signaling.Standalone.prototype.connect = function() { && this.signalingConnectionWarning === null) { this.signalingConnectionTimeout = setTimeout(() => { this.signalingConnectionWarning = showWarning(t('spreed', 'Establishing signaling connection is taking longer than expected …'), { - timeout: -1, + timeout: TOAST_PERMANENT_TIMEOUT, }) }, 2000) } @@ -601,7 +600,7 @@ Signaling.Standalone.prototype.connect = function() { } if (this.signalingConnectionError === null) { this.signalingConnectionError = showError(t('spreed', 'Failed to establish signaling connection. Retrying …'), { - timeout: -1, + timeout: TOAST_PERMANENT_TIMEOUT, }) } this.reconnect() diff --git a/src/utils/webrtc/webrtc.js b/src/utils/webrtc/webrtc.js index 4faf7c6e5..561c18836 100644 --- a/src/utils/webrtc/webrtc.js +++ b/src/utils/webrtc/webrtc.js @@ -29,7 +29,10 @@ import SimpleWebRTC from './simplewebrtc/simplewebrtc' import { PARTICIPANT } from '../../constants.js' import store from '../../store/index.js' -import { showError } from '@nextcloud/dialogs' +import { + showError, + TOAST_PERMANENT_TIMEOUT, +} from '@nextcloud/dialogs' let webrtc const spreedPeerConnectionTable = [] @@ -539,7 +542,7 @@ export default function initWebRTC(signaling, _callParticipantCollection, _local .replace('{linkstart}', '<a target="_blank" rel="noreferrer nofollow" class="external" href="https://nextcloud-talk.readthedocs.io/en/latest/TURN/">') .replace('{linkend}', ' ↗</a>'), { - timeout: -1, + timeout: TOAST_PERMANENT_TIMEOUT, isHTML: true, } ) @@ -819,7 +822,7 @@ export default function initWebRTC(signaling, _callParticipantCollection, _local // FIXME emit an event and handle it as needed instead of // calling UI code from here. localStreamRequestedTimeoutNotification = showError(t('spreed', 'This is taking longer than expected. Are the media permissions already granted (or rejected)? If yes please restart your browser, as audio and video are failing'), { - timeout: -1, + timeout: TOAST_PERMANENT_TIMEOUT, }) }, 10000) }) @@ -865,7 +868,7 @@ export default function initWebRTC(signaling, _callParticipantCollection, _local } showError(message, { - timeout: -1, + timeout: TOAST_PERMANENT_TIMEOUT, }) }) |