迁移聊天室禁音入口
This commit is contained in:
@@ -3169,15 +3169,15 @@
|
||||
* @param {boolean} muted true = 禁音,false = 开启声音
|
||||
*/
|
||||
function toggleSoundMute(muted) {
|
||||
if (window.ChatRoomTools?.setSoundMuted) {
|
||||
window.ChatRoomTools.setSoundMuted(muted);
|
||||
} else {
|
||||
localStorage.setItem(CHAT_SOUND_MUTED_STORAGE_KEY, muted ? '1' : '0');
|
||||
}
|
||||
if (muted && typeof EffectSounds !== 'undefined') {
|
||||
EffectSounds.stop(); // 立即停止当前音效
|
||||
if (window.ChatRoomTools?.toggleSoundMute) {
|
||||
window.ChatRoomTools.toggleSoundMute(muted, () => saveChatPreferences());
|
||||
return;
|
||||
}
|
||||
|
||||
localStorage.setItem(CHAT_SOUND_MUTED_STORAGE_KEY, muted ? '1' : '0');
|
||||
if (muted && typeof EffectSounds !== 'undefined') {
|
||||
EffectSounds.stop();
|
||||
}
|
||||
void saveChatPreferences();
|
||||
}
|
||||
window.toggleSoundMute = toggleSoundMute;
|
||||
|
||||
Reference in New Issue
Block a user