diff --git a/src/hooks/useFlanksourceUISnippet.tsx b/src/hooks/useFlanksourceUISnippet.tsx index d78ecc464..6f8e2cd79 100644 --- a/src/hooks/useFlanksourceUISnippet.tsx +++ b/src/hooks/useFlanksourceUISnippet.tsx @@ -14,14 +14,9 @@ export function useFlanksourceUISnippet( return; } const snippets = featureFlags?.find((flag) => { - return flag.name === "flanksource.ui.snippets"; + return flag.name === "flanksource.ui.snippets" && flag.name === "local"; }); - if (snippets?.source !== "local") { - console.warn("UI snippets can only be set at start time."); - return; - } - if (snippets && user) { try { // We need to wrap the snippet in a function to be able to pass in named @@ -36,8 +31,9 @@ export function useFlanksourceUISnippet( } catch (error) { console.error("Error executing snippet", error); } + } else { + setIsSnippetExecuted(true); } }, [featureFlags, user, organization, isSnippetExecuted]); - return null; }