refactor (client): stop importing things directly from firefish-js/src
This commit is contained in:
parent
f70c9efe6b
commit
81b9fdf397
1 changed files with 21 additions and 19 deletions
|
@ -8,12 +8,12 @@
|
||||||
<MkPagination
|
<MkPagination
|
||||||
v-else
|
v-else
|
||||||
ref="pagingComponent"
|
ref="pagingComponent"
|
||||||
v-slot="{ items }: { items: NoteEdit[] }"
|
v-slot="{ items }: { items: entities.NoteEdit[] }"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
>
|
>
|
||||||
<div ref="tlEl" class="giivymft noGap">
|
<div ref="tlEl" class="giivymft noGap">
|
||||||
<XList
|
<XList
|
||||||
v-slot="{ item }: { item: Note }"
|
v-slot="{ item }: { item: entities.Note }"
|
||||||
:items="convertNoteEditsToNotes(items)"
|
:items="convertNoteEditsToNotes(items)"
|
||||||
class="notes"
|
class="notes"
|
||||||
:no-gap="true"
|
:no-gap="true"
|
||||||
|
@ -42,7 +42,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 type { Note, NoteEdit } from "firefish-js/src/entities";
|
import type { entities } from "firefish-js";
|
||||||
|
|
||||||
const pagingComponent = ref<InstanceType<typeof MkPagination>>();
|
const pagingComponent = ref<InstanceType<typeof MkPagination>>();
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ definePageMetadata(
|
||||||
})),
|
})),
|
||||||
);
|
);
|
||||||
|
|
||||||
const note = ref<Note>({} as Note);
|
const note = ref<entities.Note>({} as entities.Note);
|
||||||
const loaded = ref(false);
|
const loaded = ref(false);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -84,8 +84,8 @@ onMounted(() => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function convertNoteEditsToNotes(noteEdits: NoteEdit[]) {
|
function convertNoteEditsToNotes(noteEdits: entities.NoteEdit[]) {
|
||||||
const now: 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,
|
||||||
|
@ -96,7 +96,9 @@ function convertNoteEditsToNotes(noteEdits: NoteEdit[]) {
|
||||||
emojis: note.value.emojis,
|
emojis: note.value.emojis,
|
||||||
};
|
};
|
||||||
|
|
||||||
return [now].concat(noteEdits).map((noteEdit: NoteEdit, index, arr): Note => {
|
return [now]
|
||||||
|
.concat(noteEdits)
|
||||||
|
.map((noteEdit: entities.NoteEdit, index, arr): entities.Note => {
|
||||||
return Object.assign({}, note.value, {
|
return Object.assign({}, note.value, {
|
||||||
historyId: noteEdit.id,
|
historyId: noteEdit.id,
|
||||||
// Conversion from updatedAt to createdAt
|
// Conversion from updatedAt to createdAt
|
||||||
|
|
Loading…
Reference in a new issue