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