-
Couldn't load subscription status.
- Fork 0
[ALS-9626] Configuration and Updates to allow explore page w/o login #555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
d44077f to
09ce691
Compare
| <div class="w-2/4"> | ||
| <!-- eslint-disable-next-line svelte/no-at-html-tags --> | ||
| {@html sanitizeHTML(description)} | ||
| {@html browser ? sanitizeHTML(description) : description} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| {@html browser ? sanitizeHTML(description) : description} | |
| {@html browser ? sanitizeHTML(description) : ''} |
Probably, if the page isn't loaded in browser yet, just return an empty string or placeholder text. Right now, we're using safe text from our config file but conceivably, we could move this stuff to a database where we'll want output sanitization in case of database corruption.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for SSR to render it
| const isStatsMatching = $derived(() => { | ||
| if ($authStats.length === 0 || $stats.length === 0) return false; | ||
| const publicLabelsByKey = new Map($stats.map((s) => [s.key, s.label])); | ||
| const authKeys = new Set($authStats.map((s) => s.key)); | ||
| return ( | ||
| $authStats.every((s) => publicLabelsByKey.get(s.key) === s.label) && | ||
| $stats.every((s) => authKeys.has(s.key)) | ||
| ); | ||
| }); | ||
| import Stat from './Stat.svelte'; | ||
| const showPublicStats = $derived( | ||
| ($stats.length > 0 && !isStatsMatching) || $authStats.length === 0, | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because in nhanes public and logged in stats are the same and always will be.
| {/if} | ||
|
|
||
| {#if $stats.length > 0} | ||
| {#if showPublicStats} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't tell, does this still show public stats after a user is logged in? It should show both their authenticated stats and the public stats after login.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Public stats are not impacted by logged in status... unless they match the auth stats
56ad83f to
63d4d38
Compare
Requires db migrations: #8