send height info, fix retry

This commit is contained in:
ThatOneCalculator 2023-07-03 00:20:50 -07:00
parent c9e6fab8ea
commit f10bc5488d
No known key found for this signature in database
GPG key ID: 8703CACD01000000
3 changed files with 25 additions and 24 deletions

View file

@ -8,7 +8,6 @@ block vars
- const isImage = note.files.length !== 0 && note.files[0].type.startsWith('image'); - const isImage = note.files.length !== 0 && note.files[0].type.startsWith('image');
- const isVideo = note.files.length !== 0 && note.files[0].type.startsWith('video'); - const isVideo = note.files.length !== 0 && note.files[0].type.startsWith('video');
- const imageUrl = isImage ? note.files[0].url : isVideo ? note.files[0].thumbnailUrl : avatarUrl; - const imageUrl = isImage ? note.files[0].url : isVideo ? note.files[0].thumbnailUrl : avatarUrl;
- const isEmbed = embed;
block title block title
= `${title} | ${instanceName}` = `${title} | ${instanceName}`

View file

@ -1,34 +1,25 @@
<template> <template>
<MkStickyContainer> <MkStickyContainer>
<template #header <div class="fcuexfpr">
><MkPageHeader <div v-if="appearNote" class="note">
:actions="headerActions" <div class="main _gap">
:tabs="headerTabs" <div class="note _gap" ref="noteContainer">
:display-back-button="true" <XNoteDetailed
:to="`#${noteId}`" :key="appearNote.id"
/></template> v-model:note="appearNote"
<MkSpacer :content-max="800" :marginMin="6"> class="note"
<div class="fcuexfpr"> />
<div v-if="appearNote" class="note">
<div class="main _gap">
<div class="note _gap">
<XNoteDetailed
:key="appearNote.id"
v-model:note="appearNote"
class="note"
/>
</div>
</div> </div>
</div> </div>
<MkError v-else-if="error" @retry="fetch()" />
<MkLoading v-else />
</div> </div>
</MkSpacer> <MkError v-else-if="error" @retry="fetchNote()" />
<MkLoading v-else />
</div>
</MkStickyContainer> </MkStickyContainer>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, watch } from "vue"; import { computed, onMounted, watch } from "vue";
import * as misskey from "calckey-js"; import * as misskey from "calckey-js";
import XNoteDetailed from "@/components/MkNoteDetailed.vue"; import XNoteDetailed from "@/components/MkNoteDetailed.vue";
import * as os from "@/os"; import * as os from "@/os";
@ -39,6 +30,7 @@ const props = defineProps<{
noteId: string; noteId: string;
}>(); }>();
const noteContainer = $ref<HTMLElement>();
let note = $ref<null | misskey.entities.Note>(); let note = $ref<null | misskey.entities.Note>();
let error = $ref(); let error = $ref();
let isRenote = $ref(false); let isRenote = $ref(false);
@ -108,6 +100,16 @@ definePageMetadata(
: null : null
) )
); );
onMounted(() => {
window.parent.postMessage(
{
type: "setHeight",
height: noteContainer?.clientHeight,
},
"*"
);
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View file

@ -60,7 +60,7 @@
/> />
</div> </div>
</div> </div>
<MkError v-else-if="error" @retry="fetch()" /> <MkError v-else-if="error" @retry="fetchNote()" />
<MkLoading v-else /> <MkLoading v-else />
</transition> </transition>
</div> </div>