Skip to content

Commit

Permalink
fix: conditional rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
VmMad committed Oct 11, 2024
1 parent 95afebb commit a5083f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function AdditionalCookiesTable(): React.JSX.Element {
const { additionalCookies } = useCookieManagerContext()
return (
<>
{additionalCookies.value?.length && (
{additionalCookies.value?.length > 0 && (
<table id="skcm-additional-cookies-table">
<thead>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function NecessaryCookiesTable(): React.JSX.Element {
const { necessaryCookies } = useCookieManagerContext()
return (
<>
{necessaryCookies.value?.length && (
{necessaryCookies.value?.length > 0 && (
<table id="skcm-necessary-cookies-table">
<thead>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export function CookieManagerProvider({ children }: React.PropsWithChildren): Re
}

useEffect(() => {
getAdditionalCookiesFromConfiguredServices(configuredServices)
const _additionalCookies = getAdditionalCookiesFromConfiguredServices(configuredServices)
setAdditionalCookies(_additionalCookies)
}, [configuredServices])

return <CookieManagerContext.Provider value={value}>{children}</CookieManagerContext.Provider>
Expand Down

0 comments on commit a5083f0

Please sign in to comment.