pinafore/src/routes/_pages/index.html
2019-02-13 18:38:44 -08:00

38 lines
1.1 KiB
HTML

{#if $isUserLoggedIn}
<TimelineHomePage/>
{:else}
<NotLoggedInHome/>
{/if}
<script>
import NotLoggedInHome from '../_components/NotLoggedInHome.html'
import { store } from '../_store/store.js'
import TimelineHomePage from '../_components/TimelineHomePage.html'
import { observe } from 'svelte-extras'
import { showShareDialogIfNecessary } from '../_actions/showShareDialogIfNecessary'
export default {
async oncreate () {
let observed = false
this.observe('currentVerifyCredentials', verifyCredentials => {
if (verifyCredentials && !observed) {
// when the verifyCredentials object is available, we can check to see
// if the user is trying to share something, then share it
observed = true
/* no await */ showShareDialogIfNecessary()
}
})
},
store: () => store,
computed: {
currentVerifyCredentials: ({ $currentVerifyCredentials }) => $currentVerifyCredentials
},
methods: {
observe
},
components: {
NotLoggedInHome,
TimelineHomePage
}
}
</script>