Turn off epub and pdf options in UI - #327
Conversation
| @@ -1,5 +1,6 @@ | |||
| <script lang="ts"> | |||
| import type { SelectElement } from './types' | |||
| import { PUBLIC_TURN_OFF_EPUB, PUBLIC_TURN_OFF_PDF } from '$env/static/public' | |||
There was a problem hiding this comment.
If I understand the initialization correctly, PUBLIC_TURN_OFF_EPUB and ...PDF come into to scope from $env/static/public as strings, which would have the values "true" and "false".
Elsewhere, if I understand svelte correctly, they appear to be treated as booleans, which means a value of "false" will still evaluate to true.
There was a problem hiding this comment.
Good catch, thank you
| </label> | ||
| </div> | ||
| {#if $docTypeStore === 'pdf'} | ||
| {#if !PUBLIC_TURN_OFF_EPUB} |
There was a problem hiding this comment.
I think this needs to be a string compare, not a boolean, e.g.:
{#if PUBLIC_TURN_OFF_EPUB !== 'true'}
There was a problem hiding this comment.
Good catch, thank you
| </label> | ||
| </div> | ||
| {/if} | ||
| {#if !PUBLIC_TURN_OFF_PDF} |
There was a problem hiding this comment.
I think this needs to be a string compare, not a boolean, e.g.:
{#if PUBLIC_TURN_OFF_PDF !== 'true'}
There was a problem hiding this comment.
Good catch, thank you
| </label> | ||
| </div> | ||
| {/if} | ||
| {#if !PUBLIC_TURN_OFF_PDF && $docTypeStore === 'pdf'} |
There was a problem hiding this comment.
I think this needs to be a string compare, not a boolean, e.g.:
{#if PUBLIC_TURN_OFF_PDF !== 'true' && ...
There was a problem hiding this comment.
Good catch, thank you
c69e664
into
WycliffeAssociates:doc-dev.walink.org
No description provided.