From 22210c73c0939808ff7189f937d761e590e6e34c Mon Sep 17 00:00:00 2001 From: Moshe Immerman Date: Tue, 18 Jun 2024 16:50:18 +0300 Subject: [PATCH] Update useFlanksourceUISnippet.tsx --- src/hooks/useFlanksourceUISnippet.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/useFlanksourceUISnippet.tsx b/src/hooks/useFlanksourceUISnippet.tsx index 6f8e2cd79..e1d66b784 100644 --- a/src/hooks/useFlanksourceUISnippet.tsx +++ b/src/hooks/useFlanksourceUISnippet.tsx @@ -14,7 +14,7 @@ export function useFlanksourceUISnippet( return; } const snippets = featureFlags?.find((flag) => { - return flag.name === "flanksource.ui.snippets" && flag.name === "local"; + return flag.name === "flanksource.ui.snippets" && flag.source === "local"; }); if (snippets && user) { @@ -31,7 +31,7 @@ export function useFlanksourceUISnippet( } catch (error) { console.error("Error executing snippet", error); } - } else { + } else if (user) { setIsSnippetExecuted(true); } }, [featureFlags, user, organization, isSnippetExecuted]);