mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-24 20:54:13 +02:00
fix(frontend): 登録日によるソートの場合はpaginator側のソートを使用するように (#17048)
* fix(frontend): 登録日によるソートの場合はpaginator側のソートを使用するように * Update Changelog * fix lint * refactor
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
- Enhance: ウィジェットの表示設定をプレビューを見ながら行えるように
|
- Enhance: ウィジェットの表示設定をプレビューを見ながら行えるように
|
||||||
- Enhance: ウィジェットの設定項目のラベルの多言語対応
|
- Enhance: ウィジェットの設定項目のラベルの多言語対応
|
||||||
- Fix: ドライブクリーナーでファイルを削除しても画面に反映されない問題を修正 #16061
|
- Fix: ドライブクリーナーでファイルを削除しても画面に反映されない問題を修正 #16061
|
||||||
|
- Fix: ドライブのソートが「登録日(昇順)」の場合に正しく動作しない問題を修正
|
||||||
|
|
||||||
### Server
|
### Server
|
||||||
- Enhance: OAuthのクライアント情報取得(Client Information Discovery)において、IndieWeb Living Standard 11 July 2024で定義されているJSONドキュメント形式に対応しました
|
- Enhance: OAuthのクライアント情報取得(Client Information Discovery)において、IndieWeb Living Standard 11 July 2024で定義されているJSONドキュメント形式に対応しました
|
||||||
|
|||||||
@@ -133,12 +133,12 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
</TransitionGroup>
|
</TransitionGroup>
|
||||||
|
|
||||||
<MkButton
|
<MkButton
|
||||||
v-show="filesPaginator.canFetchOlder.value"
|
v-show="canFetchFiles"
|
||||||
v-appear="shouldEnableInfiniteScroll ? filesPaginator.fetchOlder : null"
|
v-appear="shouldEnableInfiniteScroll ? fetchMoreFiles : null"
|
||||||
:class="$style.loadMore"
|
:class="$style.loadMore"
|
||||||
primary
|
primary
|
||||||
rounded
|
rounded
|
||||||
@click="filesPaginator.fetchOlder()"
|
@click="fetchMoreFiles"
|
||||||
>{{ i18n.ts.loadMore }}</MkButton>
|
>{{ 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">
|
||||||
@@ -238,10 +238,9 @@ const filesPaginator = markRaw(new Paginator('drive/files', {
|
|||||||
params: () => ({ // 自動でリロードしたくないためcomputedParamsは使わない
|
params: () => ({ // 自動でリロードしたくないためcomputedParamsは使わない
|
||||||
folderId: folder.value ? folder.value.id : null,
|
folderId: folder.value ? folder.value.id : null,
|
||||||
type: props.type,
|
type: props.type,
|
||||||
sort: sortModeSelect.value,
|
sort: ['-createdAt', '+createdAt'].includes(sortModeSelect.value) ? null : sortModeSelect.value,
|
||||||
}),
|
}),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const foldersPaginator = markRaw(new Paginator('drive/folders', {
|
const foldersPaginator = markRaw(new Paginator('drive/folders', {
|
||||||
limit: 30,
|
limit: 30,
|
||||||
canFetchDetection: 'limit',
|
canFetchDetection: 'limit',
|
||||||
@@ -250,6 +249,16 @@ const foldersPaginator = markRaw(new Paginator('drive/folders', {
|
|||||||
}),
|
}),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const canFetchFiles = computed(() => !fetching.value && (filesPaginator.order.value === 'oldest' ? filesPaginator.canFetchNewer.value : filesPaginator.canFetchOlder.value));
|
||||||
|
|
||||||
|
async function fetchMoreFiles() {
|
||||||
|
if (filesPaginator.order.value === 'oldest') {
|
||||||
|
filesPaginator.fetchNewer();
|
||||||
|
} else {
|
||||||
|
filesPaginator.fetchOlder();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const filesTimeline = makeDateGroupedTimelineComputedRef(filesPaginator.items, 'month');
|
const filesTimeline = makeDateGroupedTimelineComputedRef(filesPaginator.items, 'month');
|
||||||
const shouldBeGroupedByDate = computed(() => ['+createdAt', '-createdAt'].includes(sortModeSelect.value));
|
const shouldBeGroupedByDate = computed(() => ['+createdAt', '-createdAt'].includes(sortModeSelect.value));
|
||||||
|
|
||||||
@@ -260,10 +269,10 @@ watch(sortModeSelect, () => {
|
|||||||
|
|
||||||
async function initialize() {
|
async function initialize() {
|
||||||
fetching.value = true;
|
fetching.value = true;
|
||||||
await Promise.all([
|
await foldersPaginator.reload();
|
||||||
foldersPaginator.init(),
|
filesPaginator.initialDirection = sortModeSelect.value === '-createdAt' ? 'newer' : 'older';
|
||||||
filesPaginator.init(),
|
filesPaginator.order.value = sortModeSelect.value === '-createdAt' ? 'oldest' : 'newest';
|
||||||
]);
|
await filesPaginator.reload();
|
||||||
fetching.value = false;
|
fetching.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user