Skip to content

Commit

Permalink
通知グルーピング設定の即時反映対応 (#12485)
Browse files Browse the repository at this point in the history
* wip

* ログ出しの削除

* fix CHANGELOG.md

---------

Co-authored-by: osamu <46447427+sam-osamu@users.noreply.github.com>
  • Loading branch information
samunohito and samunohito authored Nov 28, 2023
1 parent 4e5b776 commit ec04c76
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
- Fix: コードエディタが正しく表示されない問題を修正
- Fix: プロフィールの「ファイル」にセンシティブな画像がある際のデザインを修正
- Fix: 一度に大量の通知が入った際に通知音が音割れする問題を修正
- Fix: 通知のグルーピング設定を変更してもリロードされるまで表示が変わらない問題を修正 #12470

### Server
- Enhance: MFM `$[ruby ]` が他ソフトウェアと連合されるように
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend/src/components/MkNotifications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>

<script lang="ts" setup>
import { onUnmounted, onDeactivated, onMounted, computed, shallowRef, onActivated } from 'vue';
import { onUnmounted, onDeactivated, onMounted, computed, shallowRef, onActivated, watch } from 'vue';
import MkPagination, { Paging } from '@/components/MkPagination.vue';
import XNotification from '@/components/MkNotification.vue';
import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue';
Expand All @@ -43,7 +43,7 @@ const props = defineProps<{

const pagingComponent = shallowRef<InstanceType<typeof MkPagination>>();

const pagination: Paging = defaultStore.state.useGroupedNotifications ? {
let pagination = $computed(() => defaultStore.reactiveState.useGroupedNotifications.value ? {
endpoint: 'i/notifications-grouped' as const,
limit: 20,
params: computed(() => ({
Expand All @@ -55,7 +55,7 @@ const pagination: Paging = defaultStore.state.useGroupedNotifications ? {
params: computed(() => ({
excludeTypes: props.excludeTypes ?? undefined,
})),
};
});

function onNotification(notification) {
const isMuted = props.excludeTypes ? props.excludeTypes.includes(notification.type) : false;
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkPagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ watch([$$(backed), $$(contentEl)], () => {
});

// パラメータに何らかの変更があった際、再読込したい(チャンネル等のIDが変わったなど)
watch(() => props.pagination.params, init, { deep: true });
watch(() => [props.pagination.endpoint, props.pagination.params], init, { deep: true });

watch(queue, (a, b) => {
if (a.size === 0 && b.size === 0) return;
Expand Down

0 comments on commit ec04c76

Please sign in to comment.