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() {
|
||||
this.notifyAudioExit();
|
||||
this.isConnected = false;
|
||||
this.isConnecting = false;
|
||||
this.isHangingUp = false;
|
||||
@ -604,7 +605,21 @@ class AudioManager {
|
||||
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() {
|
||||
this.notifyAudioExit();
|
||||
this.isConnected = false;
|
||||
this.isConnecting = false;
|
||||
this.isHangingUp = false;
|
||||
@ -616,13 +631,6 @@ class AudioManager {
|
||||
this.inputStream = null;
|
||||
}
|
||||
|
||||
if (!this.error && !this.isEchoTest) {
|
||||
this.notify(
|
||||
this.intl.formatMessage(this.messages.info.LEFT_AUDIO),
|
||||
false,
|
||||
'no_audio'
|
||||
);
|
||||
}
|
||||
if (!this.isEchoTest) {
|
||||
this.playHangUpSound();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user