From b529e9c84830459d30b95c37321fa1fa1e0a9335 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Sun, 4 Aug 2024 17:40:26 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F(frontend)=20extract=20query?= =?UTF-8?q?=20key=20in=20a=20variable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I'll need this key to sync data when the mutation responds successfully. This is a preliminary refactoring; the mutation will be added in upcoming commits. --- src/frontend/src/features/rooms/components/Conference.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/features/rooms/components/Conference.tsx b/src/frontend/src/features/rooms/components/Conference.tsx index 6ce8e830..8538dfce 100644 --- a/src/frontend/src/features/rooms/components/Conference.tsx +++ b/src/frontend/src/features/rooms/components/Conference.tsx @@ -26,8 +26,9 @@ export const Conference = ({ mode?: 'join' | 'create' initialRoomData?: ApiRoom }) => { + const fetchKey = [keys.room, roomId, userConfig.username] const { status, data } = useQuery({ - queryKey: [keys.room, roomId, userConfig.username], + queryKey: fetchKey, enabled: !initialRoomData, initialData: initialRoomData, queryFn: () =>