send height info, fix retry
This commit is contained in:
parent
c9e6fab8ea
commit
f10bc5488d
3 changed files with 25 additions and 24 deletions
|
@ -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}`
|
||||||
|
|
|
@ -1,17 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<MkStickyContainer>
|
<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 class="fcuexfpr">
|
||||||
<div v-if="appearNote" class="note">
|
<div v-if="appearNote" class="note">
|
||||||
<div class="main _gap">
|
<div class="main _gap">
|
||||||
<div class="note _gap">
|
<div class="note _gap" ref="noteContainer">
|
||||||
<XNoteDetailed
|
<XNoteDetailed
|
||||||
:key="appearNote.id"
|
:key="appearNote.id"
|
||||||
v-model:note="appearNote"
|
v-model:note="appearNote"
|
||||||
|
@ -20,15 +12,14 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<MkError v-else-if="error" @retry="fetch()" />
|
<MkError v-else-if="error" @retry="fetchNote()" />
|
||||||
<MkLoading v-else />
|
<MkLoading v-else />
|
||||||
</div>
|
</div>
|
||||||
</MkSpacer>
|
|
||||||
</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>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue