Skip to content

Turn off epub and pdf options in UI - #327

Merged
PurpleGuitar merged 2 commits into
WycliffeAssociates:doc-dev.walink.orgfrom
linearcombination:turn-off-epub-and-pdf-options
Jul 23, 2026
Merged

Turn off epub and pdf options in UI#327
PurpleGuitar merged 2 commits into
WycliffeAssociates:doc-dev.walink.orgfrom
linearcombination:turn-off-epub-and-pdf-options

Conversation

@linearcombination

Copy link
Copy Markdown
Contributor

No description provided.

@@ -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'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thank you

</label>
</div>
{#if $docTypeStore === 'pdf'}
{#if !PUBLIC_TURN_OFF_EPUB}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be a string compare, not a boolean, e.g.:

{#if PUBLIC_TURN_OFF_EPUB !== 'true'}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thank you

</label>
</div>
{/if}
{#if !PUBLIC_TURN_OFF_PDF}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be a string compare, not a boolean, e.g.:

{#if PUBLIC_TURN_OFF_PDF !== 'true'}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thank you

</label>
</div>
{/if}
{#if !PUBLIC_TURN_OFF_PDF && $docTypeStore === 'pdf'}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be a string compare, not a boolean, e.g.:

{#if PUBLIC_TURN_OFF_PDF !== 'true' && ...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thank you

@PurpleGuitar
PurpleGuitar merged commit c69e664 into WycliffeAssociates:doc-dev.walink.org Jul 23, 2026
14 of 15 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in DOC Project Management Jul 23, 2026
@linearcombination
linearcombination deleted the turn-off-epub-and-pdf-options branch July 23, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants