feat: show MkRemoteCaution in note history page
This commit is contained in:
parent
aea6659d0b
commit
f0a50bc288
1 changed files with 39 additions and 35 deletions
|
@ -4,9 +4,13 @@
|
|||
><MkPageHeader :display-back-button="true"
|
||||
/></template>
|
||||
<MkSpacer :content-max="800">
|
||||
<MkLoading v-if="!loaded" />
|
||||
<MkLoading v-if="note == null" />
|
||||
<div class="" v-else>
|
||||
<MkRemoteCaution
|
||||
v-if="note.user.host != null"
|
||||
:href="note.url ?? note.uri!"
|
||||
/>
|
||||
<MkPagination
|
||||
v-else
|
||||
ref="pagingComponent"
|
||||
v-slot="{ items }"
|
||||
:pagination="pagination"
|
||||
|
@ -28,6 +32,7 @@
|
|||
</XList>
|
||||
</div>
|
||||
</MkPagination>
|
||||
</div>
|
||||
</MkSpacer>
|
||||
</MkStickyContainer>
|
||||
</template>
|
||||
|
@ -42,6 +47,7 @@ import XNote from "@/components/MkNote.vue";
|
|||
import { i18n } from "@/i18n";
|
||||
import { definePageMetadata } from "@/scripts/page-metadata";
|
||||
import icon from "@/scripts/icon";
|
||||
import MkRemoteCaution from "@/components/MkRemoteCaution.vue";
|
||||
|
||||
const pagingComponent = ref<InstanceType<typeof MkPagination>>();
|
||||
|
||||
|
@ -65,8 +71,7 @@ definePageMetadata(
|
|||
})),
|
||||
);
|
||||
|
||||
const note = ref<entities.Note>({} as entities.Note);
|
||||
const loaded = ref(false);
|
||||
const note = ref<entities.Note | null>(null);
|
||||
|
||||
onMounted(() => {
|
||||
api("notes/show", {
|
||||
|
@ -79,20 +84,19 @@ onMounted(() => {
|
|||
res.replyId = null;
|
||||
|
||||
note.value = res;
|
||||
loaded.value = true;
|
||||
});
|
||||
});
|
||||
|
||||
function convertNoteEditsToNotes(noteEdits: entities.NoteEdit[]) {
|
||||
const now: entities.NoteEdit = {
|
||||
id: "EditionNow",
|
||||
noteId: note.value.id,
|
||||
updatedAt: note.value.createdAt,
|
||||
text: note.value.text,
|
||||
cw: note.value.cw,
|
||||
files: note.value.files,
|
||||
fileIds: note.value.fileIds,
|
||||
emojis: note.value.emojis,
|
||||
noteId: note.value!.id,
|
||||
updatedAt: note.value!.createdAt,
|
||||
text: note.value!.text,
|
||||
cw: note.value!.cw,
|
||||
files: note.value!.files,
|
||||
fileIds: note.value!.fileIds,
|
||||
emojis: note.value!.emojis,
|
||||
};
|
||||
|
||||
return [now]
|
||||
|
@ -108,7 +112,7 @@ function convertNoteEditsToNotes(noteEdits: entities.NoteEdit[]) {
|
|||
_shouldInsertAd_: false,
|
||||
files: noteEdit.files,
|
||||
fileIds: noteEdit.fileIds,
|
||||
emojis: note.value.emojis.concat(noteEdit.emojis),
|
||||
emojis: note.value!.emojis.concat(noteEdit.emojis),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue