summaryrefslogtreecommitdiff
path: root/packages/frontend/src/pages/search.note.vue
diff options
context:
space:
mode:
Diffstat (limited to 'packages/frontend/src/pages/search.note.vue')
-rw-r--r--packages/frontend/src/pages/search.note.vue17
1 files changed, 8 insertions, 9 deletions
diff --git a/packages/frontend/src/pages/search.note.vue b/packages/frontend/src/pages/search.note.vue
index 352564bc9c..f19c1e7efb 100644
--- a/packages/frontend/src/pages/search.note.vue
+++ b/packages/frontend/src/pages/search.note.vue
@@ -103,19 +103,18 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</div>
- <MkFoldableSection v-if="notePagination">
+ <MkFoldableSection v-if="paginator">
<template #header>{{ i18n.ts.searchResult }}</template>
- <MkNotesTimeline :key="`searchNotes:${key}`" :pagination="notePagination"/>
+ <MkNotesTimeline :key="`searchNotes:${key}`" :paginator="paginator"/>
</MkFoldableSection>
</div>
</template>
<script lang="ts" setup>
-import { computed, ref, shallowRef, toRef } from 'vue';
+import { computed, markRaw, ref, shallowRef, toRef } from 'vue';
+import { host as localHost } from '@@/js/config.js';
import type * as Misskey from 'misskey-js';
-import type { PagingCtx } from '@/composables/use-pagination.js';
import { $i } from '@/i.js';
-import { host as localHost } from '@@/js/config.js';
import { i18n } from '@/i18n.js';
import { instance } from '@/instance.js';
import * as os from '@/os.js';
@@ -128,6 +127,7 @@ import MkInput from '@/components/MkInput.vue';
import MkNotesTimeline from '@/components/MkNotesTimeline.vue';
import MkRadios from '@/components/MkRadios.vue';
import MkUserCardMini from '@/components/MkUserCardMini.vue';
+import { Paginator } from '@/utility/paginator.js';
const props = withDefaults(defineProps<{
query?: string;
@@ -144,7 +144,7 @@ const props = withDefaults(defineProps<{
const router = useRouter();
const key = ref(0);
-const notePagination = ref<PagingCtx<'notes/search'>>();
+const paginator = shallowRef<Paginator<'notes/search'> | null>(null);
const searchQuery = ref(toRef(props, 'query').value);
const hostInput = ref(toRef(props, 'host').value);
@@ -299,13 +299,12 @@ async function search() {
}
}
- notePagination.value = {
- endpoint: 'notes/search',
+ paginator.value = markRaw(new Paginator('notes/search', {
limit: 10,
params: {
...searchParams.value,
},
- };
+ }));
key.value++;
}