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 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 isEmbed = embed;
block title
= `${title} | ${instanceName}`

View file

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

View file

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