pinafore/src/routes/_pages/index.html

38 lines
1.1 KiB
HTML
Raw Normal View History

{#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'
2018-04-20 04:38:01 +00:00
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()
}
})
},
2018-04-20 04:38:01 +00:00
store: () => store,
computed: {
currentVerifyCredentials: ({ $currentVerifyCredentials }) => $currentVerifyCredentials
},
methods: {
observe
},
2018-04-20 04:38:01 +00:00
components: {
NotLoggedInHome,
TimelineHomePage
2018-04-20 04:38:01 +00:00
}
}
</script>