wip
This commit is contained in:
		
							parent
							
								
									dafc6b2d45
								
							
						
					
					
						commit
						8cbd3dcd42
					
				|  | @ -4,37 +4,40 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| --> | ||||
| 
 | ||||
| <template> | ||||
| <MkPagination ref="pagingComponent" :pagination="pagination" :disableAutoLoad="disableAutoLoad"> | ||||
| 	<template #empty> | ||||
| 		<div class="_fullinfo"> | ||||
| 			<img :src="infoImageUrl" draggable="false"/> | ||||
| 			<div>{{ i18n.ts.noNotes }}</div> | ||||
| 		</div> | ||||
| 	</template> | ||||
| <component :is="prefer.s.enablePullToRefresh ? MkPullToRefresh : 'div'" :refresher="() => reload()"> | ||||
| 	<MkPagination ref="pagingComponent" :pagination="pagination" :disableAutoLoad="disableAutoLoad"> | ||||
| 		<template #empty> | ||||
| 			<div class="_fullinfo"> | ||||
| 				<img :src="infoImageUrl" draggable="false"/> | ||||
| 				<div>{{ i18n.ts.noNotes }}</div> | ||||
| 			</div> | ||||
| 		</template> | ||||
| 
 | ||||
| 	<template #default="{ items: notes }"> | ||||
| 		<div :class="[$style.root, { [$style.noGap]: noGap, '_gaps': !noGap, [$style.reverse]: pagination.reversed }]"> | ||||
| 			<template v-for="(note, i) in notes" :key="note.id"> | ||||
| 				<div v-if="note._shouldInsertAd_" :class="[$style.noteWithAd, { '_gaps': !noGap }]" :data-scroll-anchor="note.id"> | ||||
| 					<MkNote :class="$style.note" :note="note" :withHardMute="true"/> | ||||
| 					<div :class="$style.ad"> | ||||
| 						<MkAd :preferForms="['horizontal', 'horizontal-big']"/> | ||||
| 		<template #default="{ items: notes }"> | ||||
| 			<div :class="[$style.root, { [$style.noGap]: noGap, '_gaps': !noGap, [$style.reverse]: pagination.reversed }]"> | ||||
| 				<template v-for="(note, i) in notes" :key="note.id"> | ||||
| 					<div v-if="note._shouldInsertAd_" :class="[$style.noteWithAd, { '_gaps': !noGap }]" :data-scroll-anchor="note.id"> | ||||
| 						<MkNote :class="$style.note" :note="note" :withHardMute="true"/> | ||||
| 						<div :class="$style.ad"> | ||||
| 							<MkAd :preferForms="['horizontal', 'horizontal-big']"/> | ||||
| 						</div> | ||||
| 					</div> | ||||
| 				</div> | ||||
| 				<MkNote v-else :class="$style.note" :note="note" :withHardMute="true" :data-scroll-anchor="note.id"/> | ||||
| 			</template> | ||||
| 		</div> | ||||
| 	</template> | ||||
| </MkPagination> | ||||
| 					<MkNote v-else :class="$style.note" :note="note" :withHardMute="true" :data-scroll-anchor="note.id"/> | ||||
| 				</template> | ||||
| 			</div> | ||||
| 		</template> | ||||
| 	</MkPagination> | ||||
| </component> | ||||
| </template> | ||||
| 
 | ||||
| <script lang="ts" setup> | ||||
| import { useTemplateRef } from 'vue'; | ||||
| import type { Paging } from '@/components/MkPagination.vue'; | ||||
| import MkNote from '@/components/MkNote.vue'; | ||||
| import MkPagination from '@/components/MkPagination.vue'; | ||||
| import { i18n } from '@/i18n.js'; | ||||
| import { infoImageUrl } from '@/instance.js'; | ||||
| import MkPullToRefresh from '@/components/MkPullToRefresh.vue'; | ||||
| import { prefer } from '@/preferences.js'; | ||||
| 
 | ||||
| const props = defineProps<{ | ||||
| 	pagination: Paging; | ||||
|  | @ -44,8 +47,12 @@ const props = defineProps<{ | |||
| 
 | ||||
| const pagingComponent = useTemplateRef('pagingComponent'); | ||||
| 
 | ||||
| function reload() { | ||||
| 	return pagingComponent.value?.paginator.reload(); | ||||
| } | ||||
| 
 | ||||
| defineExpose({ | ||||
| 	pagingComponent, | ||||
| 	reload, | ||||
| }); | ||||
| </script> | ||||
| 
 | ||||
|  |  | |||
|  | @ -48,7 +48,7 @@ async function post() { | |||
| 	await os.post(); | ||||
| 	store.set('postFormHashtags', ''); | ||||
| 	store.set('postFormWithHashtags', false); | ||||
| 	notes.value?.pagingComponent?.reload(); | ||||
| 	notes.value?.reload(); | ||||
| } | ||||
| 
 | ||||
| const headerActions = computed(() => [{ | ||||
|  |  | |||
|  | @ -35,7 +35,7 @@ const tlComponent = ref<InstanceType<typeof MkNotes>>(); | |||
| 
 | ||||
| function reloadTimeline() { | ||||
| 	return new Promise<void>((res) => { | ||||
| 		tlComponent.value?.pagingComponent?.reload().then(() => { | ||||
| 		tlComponent.value?.reload().then(() => { | ||||
| 			res(); | ||||
| 		}); | ||||
| 	}); | ||||
|  |  | |||
|  | @ -15,8 +15,8 @@ SPDX-License-Identifier: AGPL-3.0-only | |||
| import { ref } from 'vue'; | ||||
| import XColumn from './column.vue'; | ||||
| import type { Column } from '@/deck.js'; | ||||
| import { i18n } from '@/i18n.js'; | ||||
| import MkNotes from '@/components/MkNotes.vue'; | ||||
| import { i18n } from '../../i18n.js'; | ||||
| 
 | ||||
| defineProps<{ | ||||
| 	column: Column; | ||||
|  | @ -27,7 +27,7 @@ const tlComponent = ref<InstanceType<typeof MkNotes>>(); | |||
| 
 | ||||
| function reloadTimeline() { | ||||
| 	return new Promise<void>((res) => { | ||||
| 		tlComponent.value?.pagingComponent?.reload().then(() => { | ||||
| 		tlComponent.value?.reload().then(() => { | ||||
| 			res(); | ||||
| 		}); | ||||
| 	}); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue