Prevent rendering certain authenticated routes unless logged in, to avoid initial renders and onMount loaders firing

This commit is contained in:
Andrew Kingston 2021-05-18 15:29:34 +01:00
parent 3b6b3877b1
commit e76f68cee3
3 changed files with 9 additions and 14 deletions

View File

@ -1,6 +1,6 @@
<script>
import { onMount } from "svelte"
import { isActive, goto, redirect } from "@roxi/routify"
import { isActive, redirect } from "@roxi/routify"
import { auth } from "stores/backend"
import { admin } from "stores/portal"

View File

@ -1,19 +1,7 @@
<script>
import { store, automationStore } from "builderStore"
import { roles } from "stores/backend"
import {
Button,
Icon,
Modal,
ModalContent,
ActionGroup,
ActionButton,
Tabs,
Tab,
} from "@budibase/bbui"
import SettingsLink from "components/settings/Link.svelte"
import ThemeEditorDropdown from "components/settings/ThemeEditorDropdown.svelte"
import FeedbackNavLink from "components/feedback/FeedbackNavLink.svelte"
import { Button, Icon, ActionGroup, Tabs, Tab } from "@budibase/bbui"
import DeployModal from "components/deploy/DeployModal.svelte"
import RevertModal from "components/deploy/RevertModal.svelte"
import { get } from "builderStore/api"

View File

@ -0,0 +1,7 @@
<script>
import { auth } from "stores/backend"
</script>
{#if $auth.user}
<slot />
{/if}