From 424212b63e4f7d4b7dac9c8fbdd3fb11e94cf82c Mon Sep 17 00:00:00 2001 From: rasmus Date: Mon, 9 Mar 2026 03:22:48 +0100 Subject: [PATCH] add setting to toggle joining vc on room click --- src/app/features/room-nav/RoomNavItem.tsx | 4 +-- src/app/features/settings/general/General.tsx | 25 +++++++++++++++++++ src/app/state/settings.ts | 2 ++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/app/features/room-nav/RoomNavItem.tsx b/src/app/features/room-nav/RoomNavItem.tsx index 474522cdf..6ec6d8b09 100644 --- a/src/app/features/room-nav/RoomNavItem.tsx +++ b/src/app/features/room-nav/RoomNavItem.tsx @@ -44,7 +44,7 @@ import { getCanonicalAliasOrRoomId, isRoomAlias } from '$utils/matrix'; import { getViaServers } from '$plugins/via-servers'; import { useMediaAuthentication } from '$hooks/useMediaAuthentication'; import { useSetting } from '$state/hooks/settings'; -import { settingsAtom } from '$state/settings'; +import { getSettings, settingsAtom } from '$state/settings'; import { useOpenRoomSettings } from '$state/hooks/roomSettings'; import { useSpaceOptionally } from '$hooks/useSpace'; import { @@ -317,7 +317,7 @@ export function RoomNavItem({ const handleNavItemClick: MouseEventHandler = (evt) => { if (room.isCallRoom()) { if (!isMobile) { - if (!isActiveCall && !callEmbed) { + if (!isActiveCall && !callEmbed && getSettings().joinVoiceImmediately) { startCall( room, new CallControlState(callPref.microphone, callPref.video, callPref.sound) diff --git a/src/app/features/settings/general/General.tsx b/src/app/features/settings/general/General.tsx index f4932972d..4232b8ec8 100644 --- a/src/app/features/settings/general/General.tsx +++ b/src/app/features/settings/general/General.tsx @@ -924,6 +924,30 @@ function Messages() { ); } +function Navigation() { + const [joinVoiceImmediately, setJoinVoiceImmediately] = useSetting( + settingsAtom, + 'joinVoiceImmediately' + ); + return ( + + Navigation + + + } + /> + + + ); +} + export function Sync() { const clientConfig = useClientConfig(); const sessions = useAtomValue(sessionsAtom); @@ -1033,6 +1057,7 @@ export function General({ requestClose }: GeneralProps) { + diff --git a/src/app/state/settings.ts b/src/app/state/settings.ts index 7174b9818..35f3f53d6 100644 --- a/src/app/state/settings.ts +++ b/src/app/state/settings.ts @@ -48,6 +48,7 @@ export interface Settings { urlPreview: boolean; encUrlPreview: boolean; showHiddenEvents: boolean; + joinVoiceImmediately: boolean; legacyUsernameColor: boolean; allowPipVideos: boolean; @@ -122,6 +123,7 @@ const defaultSettings: Settings = { urlPreview: true, encUrlPreview: false, showHiddenEvents: false, + joinVoiceImmediately: true, legacyUsernameColor: false, allowPipVideos: false,