enhance(frontend): MkDriveで自動でもっと見るを有効化 (#17037)
* enhance(frontend): MkDriveで自動でもっと見るを有効化 * Update Changelog
This commit is contained in:
parent
c32307dca4
commit
7a5430199f
|
|
@ -4,6 +4,7 @@
|
||||||
-
|
-
|
||||||
|
|
||||||
### Client
|
### Client
|
||||||
|
- Enhance: ドライブのファイル一覧で自動でもっと見るを利用可能に
|
||||||
- Fix: ドライブクリーナーでファイルを削除しても画面に反映されない問題を修正 #16061
|
- Fix: ドライブクリーナーでファイルを削除しても画面に反映されない問題を修正 #16061
|
||||||
|
|
||||||
### Server
|
### Server
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,14 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
/>
|
/>
|
||||||
</TransitionGroup>
|
</TransitionGroup>
|
||||||
|
|
||||||
<MkButton v-show="filesPaginator.canFetchOlder.value" :class="$style.loadMore" primary rounded @click="filesPaginator.fetchOlder()">{{ i18n.ts.loadMore }}</MkButton>
|
<MkButton
|
||||||
|
v-show="filesPaginator.canFetchOlder.value"
|
||||||
|
v-appear="shouldEnableInfiniteScroll ? filesPaginator.fetchOlder : null"
|
||||||
|
:class="$style.loadMore"
|
||||||
|
primary
|
||||||
|
rounded
|
||||||
|
@click="filesPaginator.fetchOlder()"
|
||||||
|
>{{ i18n.ts.loadMore }}</MkButton>
|
||||||
|
|
||||||
<div v-if="filesPaginator.items.value.length == 0 && foldersPaginator.items.value.length == 0 && !fetching" :class="$style.empty">
|
<div v-if="filesPaginator.items.value.length == 0 && foldersPaginator.items.value.length == 0 && !fetching" :class="$style.empty">
|
||||||
<div v-if="draghover">{{ i18n.ts.dropHereToUpload }}</div>
|
<div v-if="draghover">{{ i18n.ts.dropHereToUpload }}</div>
|
||||||
|
|
@ -182,10 +189,12 @@ const props = withDefaults(defineProps<{
|
||||||
type?: string;
|
type?: string;
|
||||||
multiple?: boolean;
|
multiple?: boolean;
|
||||||
select?: 'file' | 'folder' | null;
|
select?: 'file' | 'folder' | null;
|
||||||
|
forceDisableInfiniteScroll?: boolean;
|
||||||
}>(), {
|
}>(), {
|
||||||
initialFolder: null,
|
initialFolder: null,
|
||||||
multiple: false,
|
multiple: false,
|
||||||
select: null,
|
select: null,
|
||||||
|
forceDisableInfiniteScroll: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
|
|
@ -194,6 +203,10 @@ const emit = defineEmits<{
|
||||||
(ev: 'cd', v: Misskey.entities.DriveFolder | null): void;
|
(ev: 'cd', v: Misskey.entities.DriveFolder | null): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
const shouldEnableInfiniteScroll = computed(() => {
|
||||||
|
return prefer.r.enableInfiniteScroll.value && !props.forceDisableInfiniteScroll;
|
||||||
|
});
|
||||||
|
|
||||||
const folder = ref<Misskey.entities.DriveFolder | null>(null);
|
const folder = ref<Misskey.entities.DriveFolder | null>(null);
|
||||||
const hierarchyFolders = ref<Misskey.entities.DriveFolder[]>([]);
|
const hierarchyFolders = ref<Misskey.entities.DriveFolder[]>([]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ export const appearDirective = {
|
||||||
const fn = binding.value;
|
const fn = binding.value;
|
||||||
if (fn == null) return;
|
if (fn == null) return;
|
||||||
|
|
||||||
const check = throttle<IntersectionObserverCallback>(1000, (entries) => {
|
const check = throttle<IntersectionObserverCallback>(500, (entries) => {
|
||||||
if (entries.some(entry => entry.isIntersecting)) {
|
if (entries.some(entry => entry.isIntersecting)) {
|
||||||
fn();
|
fn();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue