Compare commits

...

2 commits

Author SHA1 Message Date
Daniel Roe
687033b5c4
fix: add condition to make types happy 2022-12-22 15:24:48 +00:00
Daniel Roe
17127bfefc
perf: lazy load publish widget chunk 2022-12-22 15:07:34 +00:00
3 changed files with 13 additions and 13 deletions

View file

@ -29,29 +29,29 @@ useEventListener('keydown', (e: KeyboardEvent) => {
</script>
<template>
<template v-if="isMastoInitialised">
<ModalDialog v-model="isPreviewHelpOpen" max-w-125>
<LazyHelpPreview @close="closePreviewHelp()" />
</ModalDialog>
<ClientOnly v-if="isMastoInitialised">
<ModalDialog v-model="isSigninDialogOpen" py-4 px-8 max-w-125>
<UserSignIn />
</ModalDialog>
<ModalDialog v-model="isPreviewHelpOpen" max-w-125>
<HelpPreview @close="closePreviewHelp()" />
<LazyUserSignIn />
</ModalDialog>
<ModalDialog v-model="isPublishDialogOpen" max-w-180 flex>
<!-- This `w-0` style is used to avoid overflow problems in flex layoutsso don't remove it unless you know what you're doing -->
<PublishWidget :draft-key="dialogDraftKey" expanded flex-1 w-0 />
<LazyPublishWidget v-if="currentUser" :draft-key="dialogDraftKey" expanded flex-1 w-0 />
</ModalDialog>
<ModalDialog
v-model="isMediaPreviewOpen"
w-full max-w-full h-full max-h-full
bg-transparent border-0 shadow-none
>
<ModalMediaPreview v-if="isMediaPreviewOpen" @close="closeMediaPreview()" />
<LazyModalMediaPreview v-if="isMediaPreviewOpen" @close="closeMediaPreview()" />
</ModalDialog>
<ModalDialog v-model="isEditHistoryDialogOpen" max-w-125>
<StatusEditPreview :edit="statusEdit" />
<LazyStatusEditPreview :edit="statusEdit" />
</ModalDialog>
<ModalDialog v-model="isCommandPanelOpen" max-w-fit flex>
<CommandPanel @close="closeCommandPanel()" />
<LazyCommandPanel @close="closeCommandPanel()" />
</ModalDialog>
</template>
</ClientOnly>
</template>

View file

@ -71,8 +71,8 @@ onReactivated(() => {
border="t base"
style="scroll-margin-top: 60px"
/>
<PublishWidget
v-if="currentUser"
<LazyPublishWidget
v-if="isMastoInitialised && currentUser"
ref="publishWidget"
:draft-key="replyDraft!.key"
:initial="replyDraft!.draft"

View file

@ -30,7 +30,7 @@ useHeadFixed({
</NuxtLink>
</template>
<slot>
<PublishWidget draft-key="home" border="b base" />
<LazyPublishWidget v-if="isMastoInitialised && currentUser" draft-key="home" border="b base" />
<TimelinePaginator v-bind="{ paginator, stream }" context="home" />
</slot>
</MainContent>