Merge branch 'feat/show-MkRemoteCaution-in-history' into 'develop'
feat: show MkRemoteCaution in note history page Co-authored-by: Lhcfl <Lhcfl@outlook.com> See merge request firefish/firefish!10743
This commit is contained in:
commit
b3cc01c440
1 changed files with 39 additions and 35 deletions
|
@ -4,9 +4,13 @@
|
||||||
><MkPageHeader :display-back-button="true"
|
><MkPageHeader :display-back-button="true"
|
||||||
/></template>
|
/></template>
|
||||||
<MkSpacer :content-max="800">
|
<MkSpacer :content-max="800">
|
||||||
<MkLoading v-if="!loaded" />
|
<MkLoading v-if="note == null" />
|
||||||
|
<div v-else>
|
||||||
|
<MkRemoteCaution
|
||||||
|
v-if="note.user.host != null"
|
||||||
|
:href="note.url ?? note.uri!"
|
||||||
|
/>
|
||||||
<MkPagination
|
<MkPagination
|
||||||
v-else
|
|
||||||
ref="pagingComponent"
|
ref="pagingComponent"
|
||||||
v-slot="{ items }"
|
v-slot="{ items }"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
|
@ -28,6 +32,7 @@
|
||||||
</XList>
|
</XList>
|
||||||
</div>
|
</div>
|
||||||
</MkPagination>
|
</MkPagination>
|
||||||
|
</div>
|
||||||
</MkSpacer>
|
</MkSpacer>
|
||||||
</MkStickyContainer>
|
</MkStickyContainer>
|
||||||
</template>
|
</template>
|
||||||
|
@ -44,6 +49,7 @@ import XNote from "@/components/MkNote.vue";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
import { definePageMetadata } from "@/scripts/page-metadata";
|
import { definePageMetadata } from "@/scripts/page-metadata";
|
||||||
import icon from "@/scripts/icon";
|
import icon from "@/scripts/icon";
|
||||||
|
import MkRemoteCaution from "@/components/MkRemoteCaution.vue";
|
||||||
|
|
||||||
const pagingComponent = ref<MkPaginationType<
|
const pagingComponent = ref<MkPaginationType<
|
||||||
typeof pagination.endpoint
|
typeof pagination.endpoint
|
||||||
|
@ -69,8 +75,7 @@ definePageMetadata(
|
||||||
})),
|
})),
|
||||||
);
|
);
|
||||||
|
|
||||||
const note = ref<entities.Note>({} as entities.Note);
|
const note = ref<entities.Note | null>(null);
|
||||||
const loaded = ref(false);
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
api("notes/show", {
|
api("notes/show", {
|
||||||
|
@ -83,20 +88,19 @@ onMounted(() => {
|
||||||
res.replyId = null;
|
res.replyId = null;
|
||||||
|
|
||||||
note.value = res;
|
note.value = res;
|
||||||
loaded.value = true;
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function convertNoteEditsToNotes(noteEdits: entities.NoteEdit[]) {
|
function convertNoteEditsToNotes(noteEdits: entities.NoteEdit[]) {
|
||||||
const now: entities.NoteEdit = {
|
const now: entities.NoteEdit = {
|
||||||
id: "EditionNow",
|
id: "EditionNow",
|
||||||
noteId: note.value.id,
|
noteId: note.value!.id,
|
||||||
updatedAt: note.value.createdAt,
|
updatedAt: note.value!.createdAt,
|
||||||
text: note.value.text,
|
text: note.value!.text,
|
||||||
cw: note.value.cw,
|
cw: note.value!.cw,
|
||||||
files: note.value.files,
|
files: note.value!.files,
|
||||||
fileIds: note.value.fileIds,
|
fileIds: note.value!.fileIds,
|
||||||
emojis: note.value.emojis,
|
emojis: note.value!.emojis,
|
||||||
};
|
};
|
||||||
|
|
||||||
return [now]
|
return [now]
|
||||||
|
@ -112,7 +116,7 @@ function convertNoteEditsToNotes(noteEdits: entities.NoteEdit[]) {
|
||||||
_shouldInsertAd_: false,
|
_shouldInsertAd_: false,
|
||||||
files: noteEdit.files,
|
files: noteEdit.files,
|
||||||
fileIds: noteEdit.fileIds,
|
fileIds: noteEdit.fileIds,
|
||||||
emojis: note.value.emojis.concat(noteEdit.emojis),
|
emojis: note.value!.emojis.concat(noteEdit.emojis),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue