-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix (Public URLs): state initialization (#6126)
* Fix public URL state initialization * Fix lint * Reactivity just in case
- Loading branch information
1 parent
c4c4461
commit 68e069e
Showing
2 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
web-admin/src/features/public-urls/DashboardPublicURLStateProvider.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script lang="ts"> | ||
import type { V1MagicAuthToken } from "@rilldata/web-admin/client"; | ||
import { getStateManagers } from "@rilldata/web-common/features/dashboards/state-managers/state-managers"; | ||
import { createDashboardStateSync } from "@rilldata/web-common/features/dashboards/stores/syncDashboardState"; | ||
import { initLocalUserPreferenceStore } from "@rilldata/web-common/features/dashboards/user-preferences"; | ||
import Spinner from "@rilldata/web-common/features/entity-management/Spinner.svelte"; | ||
import { EntityStatus } from "@rilldata/web-common/features/entity-management/types"; | ||
import { readable } from "svelte/store"; | ||
export let exploreName: string; | ||
export let token: V1MagicAuthToken; | ||
$: initLocalUserPreferenceStore(exploreName); | ||
$: dashboardStoreReady = createDashboardStateSync( | ||
getStateManagers(), | ||
readable({ | ||
isFetching: false, | ||
data: token.state, | ||
error: null, | ||
}), | ||
); | ||
</script> | ||
|
||
{#if $dashboardStoreReady} | ||
<slot /> | ||
{:else} | ||
<div class="grid place-items-center mt-40"> | ||
<Spinner status={EntityStatus.Running} size="40px" /> | ||
</div> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68e069e
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.
🎉 Published on https://ui.rilldata.io as production
🚀 Deployed on https://673f6d590d52ee3b06ee8246--rill-ui-stage.netlify.app