diff options
author | Vincent Petry <vincent@nextcloud.com> | 2020-10-19 16:24:39 +0300 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2020-10-29 12:16:29 +0300 |
commit | 895bb65c96a79d2e96161927dd48c022298c6a10 (patch) | |
tree | 3484ec2c8860743769542d691f71ffd36ab2b853 /src | |
parent | 05b3d39308aceb0b2537d886ac1c3ef1af33b767 (diff) |
Add default timeout for known error messages
Added default timeout instead of permanent for messages related to
denied permissions.
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/CallView/shared/LocalVideo.vue | 4 | ||||
-rw-r--r-- | src/utils/webrtc/webrtc.js | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/components/CallView/shared/LocalVideo.vue b/src/components/CallView/shared/LocalVideo.vue index 8a045b0ff..af72fc9e1 100644 --- a/src/components/CallView/shared/LocalVideo.vue +++ b/src/components/CallView/shared/LocalVideo.vue @@ -78,7 +78,7 @@ import SHA1 from 'crypto-js/sha1' import { showError, showInfo, - TOAST_PERMANENT_TIMEOUT, + TOAST_DEFAULT_TIMEOUT, } from '@nextcloud/dialogs' import video from '../../../mixins/video.js' import VideoBackground from './VideoBackground' @@ -208,7 +208,7 @@ export default { handler: function(localStreamVideoError) { if (localStreamVideoError) { showError(t('spreed', 'Error while accessing camera'), { - timeout: TOAST_PERMANENT_TIMEOUT, + timeout: TOAST_DEFAULT_TIMEOUT, }) } }, diff --git a/src/utils/webrtc/webrtc.js b/src/utils/webrtc/webrtc.js index 72e5de135..4de1c84f9 100644 --- a/src/utils/webrtc/webrtc.js +++ b/src/utils/webrtc/webrtc.js @@ -32,6 +32,7 @@ import store from '../../store/index.js' import { showError, TOAST_PERMANENT_TIMEOUT, + TOAST_DEFAULT_TIMEOUT, } from '@nextcloud/dialogs' let webrtc @@ -919,6 +920,7 @@ export default function initWebRTC(signaling, _callParticipantCollection, _local clearLocalStreamRequestedTimeoutAndHideNotification() let message + let timeout = TOAST_PERMANENT_TIMEOUT if ((error.name === 'NotSupportedError' && webrtc.capabilities.supportRTCPeerConnection) || (error.name === 'NotAllowedError' @@ -927,6 +929,7 @@ export default function initWebRTC(signaling, _callParticipantCollection, _local message += ': ' + t('spreed', 'Please move your setup to HTTPS') } else if (error.name === 'NotAllowedError') { message = t('spreed', 'Access to microphone & camera was denied') + timeout = TOAST_DEFAULT_TIMEOUT } else if (!webrtc.capabilities.support) { console.error('WebRTC not supported') @@ -935,10 +938,11 @@ export default function initWebRTC(signaling, _callParticipantCollection, _local } else { message = t('spreed', 'Error while accessing microphone & camera') console.error('Error while accessing microphone & camera: ', error.message || error.name) + timeout = TOAST_DEFAULT_TIMEOUT } showError(message, { - timeout: TOAST_PERMANENT_TIMEOUT, + timeout: timeout, }) }) |