From e683376b4a12e4eaba681e2b649e79f4b00e30f4 Mon Sep 17 00:00:00 2001 From: clement Date: Tue, 12 Nov 2024 16:27:58 +0100 Subject: [PATCH] fix(screeb-sdk-react): isLoaded true on init --- packages/screeb-sdk-react/src/provider.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/screeb-sdk-react/src/provider.tsx b/packages/screeb-sdk-react/src/provider.tsx index 8258142..77dafe0 100644 --- a/packages/screeb-sdk-react/src/provider.tsx +++ b/packages/screeb-sdk-react/src/provider.tsx @@ -79,7 +79,7 @@ export const ScreebProvider: React.FC< isLoaded.current = false; isInitialized = false; } - }, [isLoaded.current]); + }, [isLoaded.current, isInitialized]); const debug = React.useCallback( async () => await ensureScreeb("debug", () => Screeb.debug()), @@ -156,6 +156,7 @@ export const ScreebProvider: React.FC< Screeb.init(websiteId, userId, userProperties, hooks, language); isInitialized = true; + isLoaded.current = true; } }, true,