Skip to content

Commit 8f03b2b

Browse files
committed
fix: only throw in strict mode when service id missing
1 parent df5383f commit 8f03b2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hooks/use-has-service-consent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const useHasServiceConsent = (serviceId: ServiceId): boolean | null => {
2525
return consents[serviceId] ?? null
2626
}
2727

28-
if (strictMode) {
28+
if (strictMode && !(serviceId in consents)) {
2929
throw new Error(`Usercentrics Service not found for id "${serviceId}"`)
3030
}
3131

0 commit comments

Comments
 (0)