wip
This commit is contained in:
@@ -79,7 +79,7 @@ const POLLING_INTERVAL = 1000 * 15;
|
|||||||
|
|
||||||
if (!store.s.realtimeMode) {
|
if (!store.s.realtimeMode) {
|
||||||
useInterval(async () => {
|
useInterval(async () => {
|
||||||
const isTop = isHeadVisible(rootEl.value, 16);
|
const isTop = rootEl.value == null ? false : isHeadVisible(rootEl.value, 16);
|
||||||
paginator.fetchNewer({
|
paginator.fetchNewer({
|
||||||
toQueue: !isTop,
|
toQueue: !isTop,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -71,10 +71,6 @@ function appearFetchMore() {
|
|||||||
paginator.fetchOlder();
|
paginator.fetchOlder();
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
paginator.init();
|
|
||||||
});
|
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
paginator: paginator,
|
paginator: paginator,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ const POLLING_INTERVAL = 1000 * 15;
|
|||||||
|
|
||||||
if (!store.s.realtimeMode) {
|
if (!store.s.realtimeMode) {
|
||||||
useInterval(async () => {
|
useInterval(async () => {
|
||||||
const isTop = isHeadVisible(rootEl.value, 16);
|
const isTop = rootEl.value == null ? false : isHeadVisible(rootEl.value, 16);
|
||||||
paginator.fetchNewer({
|
paginator.fetchNewer({
|
||||||
toQueue: !isTop,
|
toQueue: !isTop,
|
||||||
});
|
});
|
||||||
@@ -313,10 +313,6 @@ const paginator = usePagination({
|
|||||||
ctx: paginationQuery,
|
ctx: paginationQuery,
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
paginator.init();
|
|
||||||
});
|
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
disconnectChannel();
|
disconnectChannel();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { computed, isRef, ref, watch } from 'vue';
|
import { computed, isRef, onMounted, ref, watch } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import type { ComputedRef, Ref, ShallowRef } from 'vue';
|
import type { ComputedRef, Ref, ShallowRef } from 'vue';
|
||||||
import { misskeyApi } from '@/utility/misskey-api.js';
|
import { misskeyApi } from '@/utility/misskey-api.js';
|
||||||
@@ -178,6 +178,10 @@ export function usePagination<Ctx extends PagingCtx, T = Misskey.Endpoints[Ctx['
|
|||||||
queue.value = [];
|
queue.value = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
init();
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
items,
|
items,
|
||||||
queue,
|
queue,
|
||||||
|
|||||||
Reference in New Issue
Block a user