fix: handle canceled accompaniment sharing

This commit is contained in:
illusia committed 2026-09-04 10:37:38 +08:00
1 parent 0986c65551
commit d42e7a033c
1 file changed
+6 -6
+6 -6
View File
@@ -1394,14 +1394,14 @@ function toggleMicrophone(): void {
} }
async function toggleAccompaniment(): Promise<void> { async function toggleAccompaniment(): Promise<void> {
if (accompanimentActive.value) {
await stopAccompaniment();
showToast(t("accompanimentStopped"));
return;
}
try { try {
if (accompanimentActive.value) {
await stopAccompaniment();
showToast(t("accompanimentStopped"));
return;
}
await startAccompaniment(); await startAccompaniment();
showToast(t("accompanimentStarted")); if (accompanimentActive.value) showToast(t("accompanimentStarted"));
} catch { } catch {
const messageKey = accompanimentErrorCode.value === "needsWebRtc" const messageKey = accompanimentErrorCode.value === "needsWebRtc"
? "accompanimentNeedsWebRtc" ? "accompanimentNeedsWebRtc"