fix(context-menu): update all checkbox call sites to reactive subscribe+getChecked
This commit is contained in:
@@ -492,12 +492,12 @@ export function MobileSpacesScreen() {
|
||||
items.push({ key: 'mod-end-sep', type: 'separator' });
|
||||
}
|
||||
|
||||
const isUserMuted = useVoiceStore.getState().participantMutes.get(userId) ?? false;
|
||||
items.push({
|
||||
key: 'mute-user',
|
||||
type: 'checkbox',
|
||||
label: 'Mute User',
|
||||
checked: isUserMuted,
|
||||
subscribe: useVoiceStore.subscribe,
|
||||
getChecked: () => useVoiceStore.getState().participantMutes.get(userId) ?? false,
|
||||
onChange: (checked) => useVoiceStore.getState().setParticipantMute(userId, checked),
|
||||
});
|
||||
|
||||
|
||||
@@ -123,12 +123,12 @@ export function MobileVoiceFullScreen() {
|
||||
}
|
||||
|
||||
// Local mute checkbox
|
||||
const isUserMuted = useVoiceStore.getState().participantMutes.get(userId) ?? false;
|
||||
items.push({
|
||||
key: 'mute-user',
|
||||
type: 'checkbox',
|
||||
label: 'Mute User',
|
||||
checked: isUserMuted,
|
||||
subscribe: useVoiceStore.subscribe,
|
||||
getChecked: () => useVoiceStore.getState().participantMutes.get(userId) ?? false,
|
||||
onChange: (checked) => useVoiceStore.getState().setParticipantMute(userId, checked),
|
||||
});
|
||||
|
||||
|
||||
@@ -286,12 +286,12 @@ export function StreamTile({ tile, large }: StreamTileProps) {
|
||||
items.push({ key: 'watch-sep', type: 'separator' });
|
||||
|
||||
// Mute Stream checkbox
|
||||
const isStreamMuted = useVoiceStore.getState().streamMutes.get(userId) ?? false;
|
||||
items.push({
|
||||
key: 'mute-stream',
|
||||
type: 'checkbox',
|
||||
label: 'Mute Stream',
|
||||
checked: isStreamMuted,
|
||||
subscribe: useVoiceStore.subscribe,
|
||||
getChecked: () => useVoiceStore.getState().streamMutes.get(userId) ?? false,
|
||||
onChange: (checked) => useVoiceStore.getState().setStreamMute(userId, checked),
|
||||
});
|
||||
|
||||
|
||||
@@ -83,12 +83,12 @@ export function VoiceChannel({ channelId, channelName, onClick, locked, canManag
|
||||
}
|
||||
|
||||
// Mute User checkbox
|
||||
const isUserMuted = useVoiceStore.getState().participantMutes.get(userId) ?? false;
|
||||
items.push({
|
||||
key: 'mute-user',
|
||||
type: 'checkbox',
|
||||
label: 'Mute User',
|
||||
checked: isUserMuted,
|
||||
subscribe: useVoiceStore.subscribe,
|
||||
getChecked: () => useVoiceStore.getState().participantMutes.get(userId) ?? false,
|
||||
onChange: (checked) => useVoiceStore.getState().setParticipantMute(userId, checked),
|
||||
});
|
||||
|
||||
|
||||
@@ -116,12 +116,12 @@ export function VoiceUser({ tile, large }: VoiceUserProps) {
|
||||
}
|
||||
|
||||
// Mute User checkbox
|
||||
const isUserMuted = useVoiceStore.getState().participantMutes.get(targetUserId) ?? false;
|
||||
items.push({
|
||||
key: 'mute-user',
|
||||
type: 'checkbox',
|
||||
label: 'Mute User',
|
||||
checked: isUserMuted,
|
||||
subscribe: useVoiceStore.subscribe,
|
||||
getChecked: () => useVoiceStore.getState().participantMutes.get(targetUserId) ?? false,
|
||||
onChange: (checked) => useVoiceStore.getState().setParticipantMute(targetUserId, checked),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user