diff --git a/frontend/src/lib/components/triggers/http/RouteCorsOption.svelte b/frontend/src/lib/components/triggers/http/RouteCorsOption.svelte index f66a3c0c69..792f223831 100644 --- a/frontend/src/lib/components/triggers/http/RouteCorsOption.svelte +++ b/frontend/src/lib/components/triggers/http/RouteCorsOption.svelte @@ -48,11 +48,14 @@ return undefined } + // Independent of the toggle: it decides what the toggle is called, which must + // not change as it is flipped. + let hasInstanceDefault = $derived( + instanceDefaultOrigins.length > 0 && !instanceDefaultOrigins.includes('*') + ) // Without this the toggle reading "off" would look like "callable from // anywhere" on an instance that has narrowed the default. - let inheritsInstanceDefault = $derived( - !restricted && instanceDefaultOrigins.length > 0 && !instanceDefaultOrigins.includes('*') - ) + let inheritsInstanceDefault = $derived(!restricted && hasInstanceDefault) let origins = $derived(parse(raw)) // Split from `error` so an entry that is merely still empty reads as a hint @@ -91,22 +94,18 @@ }) - +