fix
This commit is contained in:
parent
58bdd7c129
commit
f6f6384acf
|
@ -33,12 +33,14 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { shallowRef } from 'vue';
|
import { computed, shallowRef } from 'vue';
|
||||||
import MkNote from '@/components/MkNote.vue';
|
import MkNote from '@/components/MkNote.vue';
|
||||||
import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue';
|
import MkDateSeparatedList, { MisskeyEntity } from '@/components/MkDateSeparatedList.vue';
|
||||||
import MkPagination, { Paging } from '@/components/MkPagination.vue';
|
import MkPagination, { Paging } from '@/components/MkPagination.vue';
|
||||||
import { i18n } from '@/i18n';
|
import { i18n } from '@/i18n';
|
||||||
import { infoImageUrl } from '@/instance';
|
import { infoImageUrl } from '@/instance';
|
||||||
|
import { noteManager } from '@/scripts/entity-manager';
|
||||||
|
import { Note } from 'misskey-js/built/entities';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
pagination: Paging;
|
pagination: Paging;
|
||||||
|
@ -47,6 +49,23 @@ const props = defineProps<{
|
||||||
|
|
||||||
const pagingComponent = shallowRef<InstanceType<typeof MkPagination>>();
|
const pagingComponent = shallowRef<InstanceType<typeof MkPagination>>();
|
||||||
|
|
||||||
|
const transform = (notes: Note[]): MisskeyEntity[] => {
|
||||||
|
return notes.map(note => {
|
||||||
|
noteManager.set(note);
|
||||||
|
return {
|
||||||
|
id: note.id,
|
||||||
|
createdAt: note.createdAt,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const pagination = computed(() => {
|
||||||
|
return {
|
||||||
|
transform,
|
||||||
|
...props.pagination,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
pagingComponent,
|
pagingComponent,
|
||||||
});
|
});
|
||||||
|
|
|
@ -26,9 +26,6 @@ import { $i } from '@/account';
|
||||||
import { defaultStore } from '@/store';
|
import { defaultStore } from '@/store';
|
||||||
import { i18n } from '@/i18n';
|
import { i18n } from '@/i18n';
|
||||||
import { instance } from '@/instance';
|
import { instance } from '@/instance';
|
||||||
import { noteManager } from '@/scripts/entity-manager';
|
|
||||||
import { Note } from 'misskey-js/built/entities';
|
|
||||||
import { MisskeyEntity } from '@/types/date-separated-list';
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
src: string;
|
src: string;
|
||||||
|
@ -65,16 +62,6 @@ const prepend = note => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const transform = (notes: Note[]): MisskeyEntity[] => {
|
|
||||||
return notes.map(note => {
|
|
||||||
noteManager.set(note);
|
|
||||||
return {
|
|
||||||
id: note.id,
|
|
||||||
createdAt: note.createdAt,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
let endpoint;
|
let endpoint;
|
||||||
let query;
|
let query;
|
||||||
let connection;
|
let connection;
|
||||||
|
@ -178,7 +165,6 @@ const pagination = {
|
||||||
endpoint: endpoint,
|
endpoint: endpoint,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
params: query,
|
params: query,
|
||||||
transform: transform,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
|
Loading…
Reference in New Issue