Merge pull request #20004 from prlanzarin/u27/fix/audio-less-toasts
[2.7] fix(audio): minimize redundant audio exit toasts
This commit is contained in:
commit
6eaf8cd44d
@ -475,6 +475,7 @@ class AudioManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
forceExitAudio() {
|
forceExitAudio() {
|
||||||
|
this.notifyAudioExit();
|
||||||
this.isConnected = false;
|
this.isConnected = false;
|
||||||
this.isConnecting = false;
|
this.isConnecting = false;
|
||||||
this.isHangingUp = false;
|
this.isHangingUp = false;
|
||||||
@ -604,7 +605,21 @@ class AudioManager {
|
|||||||
this.isConnecting = true;
|
this.isConnecting = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Must be called before the call is actually torn down (this.isConnected = true)
|
||||||
|
notifyAudioExit() {
|
||||||
|
try {
|
||||||
|
if (!this.error && (this.isConnected && !this.isEchoTest)) {
|
||||||
|
this.notify(
|
||||||
|
this.intl.formatMessage(this.messages.info.LEFT_AUDIO),
|
||||||
|
false,
|
||||||
|
'no_audio',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
onAudioExit() {
|
onAudioExit() {
|
||||||
|
this.notifyAudioExit();
|
||||||
this.isConnected = false;
|
this.isConnected = false;
|
||||||
this.isConnecting = false;
|
this.isConnecting = false;
|
||||||
this.isHangingUp = false;
|
this.isHangingUp = false;
|
||||||
@ -616,13 +631,6 @@ class AudioManager {
|
|||||||
this.inputStream = null;
|
this.inputStream = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.error && !this.isEchoTest) {
|
|
||||||
this.notify(
|
|
||||||
this.intl.formatMessage(this.messages.info.LEFT_AUDIO),
|
|
||||||
false,
|
|
||||||
'no_audio'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (!this.isEchoTest) {
|
if (!this.isEchoTest) {
|
||||||
this.playHangUpSound();
|
this.playHangUpSound();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user