From 267f3b64fc94dca8839a581b3c9eb6dd4feac633 Mon Sep 17 00:00:00 2001 From: malmen237 Date: Tue, 9 Apr 2024 11:40:32 +0200 Subject: [PATCH 1/2] fix: changed reload production list-default value --- src/global-state/global-state-reducer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/global-state/global-state-reducer.ts b/src/global-state/global-state-reducer.ts index b397fbd2..533a3d87 100644 --- a/src/global-state/global-state-reducer.ts +++ b/src/global-state/global-state-reducer.ts @@ -6,7 +6,7 @@ import { uniqBy } from "../helpers"; const initialGlobalState: TGlobalState = { production: null, error: null, - reloadProductionList: true, + reloadProductionList: false, devices: null, joinProductionOptions: null, }; From d485fb4f5d544d172d4dd2c82ca131d7f97c81da Mon Sep 17 00:00:00 2001 From: malmen237 Date: Tue, 9 Apr 2024 11:41:42 +0200 Subject: [PATCH 2/2] fix: added use effect to set loader to true --- src/components/landing-page/productions-list.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/landing-page/productions-list.tsx b/src/components/landing-page/productions-list.tsx index 3096786f..973c13ce 100644 --- a/src/components/landing-page/productions-list.tsx +++ b/src/components/landing-page/productions-list.tsx @@ -35,6 +35,14 @@ export const ProductionsList = () => { const [productions, setProductions] = useState([]); const [{ reloadProductionList }, dispatch] = useGlobalState(); + useEffect(() => { + if (productions.length < 1) { + dispatch({ + type: "PRODUCTION_CREATED", + }); + } + }, [dispatch, productions]); + // TODO extract to separate hook file useEffect(() => { let aborted = false;