diff --git a/src/components/DataTable.vue b/src/components/DataTable.vue index ecdf8443..275c19fe 100644 --- a/src/components/DataTable.vue +++ b/src/components/DataTable.vue @@ -63,10 +63,6 @@ layout: { type: String, default: 'table, pagination' - }, - defaultSort: { - type: Object, - default: () => ({ prop: 'created_at', order: 'descending' }) } }, emits: [ @@ -84,8 +80,8 @@ const internalCurrentPage = ref(currentPage.value); const internalPageSize = ref(pageSize.value); const sortData = ref({ - prop: props.defaultSort?.prop || null, - order: props.defaultSort?.order || null + prop: props.tableProps.defaultSort?.prop || 'created_at', + order: props.tableProps.defaultSort?.order || 'descending' }); const showPagination = computed(() => { @@ -201,7 +197,7 @@ }); watch( - () => props.defaultSort, + () => props.tableProps.defaultSort, (newSort) => { if (newSort) { sortData.value = { diff --git a/src/stores/moderation.js b/src/stores/moderation.js index a6ac4f48..893e75cb 100644 --- a/src/stores/moderation.js +++ b/src/stores/moderation.js @@ -80,6 +80,15 @@ export const useModerationStore = defineStore('Moderation', () => { userRef.$moderations = getUserModerations(ref.targetUserId); } + const array = state.playerModerationTable.data; + const { length } = array; + for (let i = 0; i < length; ++i) { + if (array[i].id === ref.id) { + array.splice(i, 1); + break; + } + } + const D = userStore.userDialog; if ( D.visible === false || @@ -99,15 +108,6 @@ export const useModerationStore = defineStore('Moderation', () => { } else if (ref.type === 'muteChat') { D.isMuteChat = false; } - - const array = state.playerModerationTable.data; - const { length } = array; - for (let i = 0; i < length; ++i) { - if (array[i].id === ref.id) { - array.splice(i, 1); - break; - } - } } function handlePlayerModerationDelete(args) { diff --git a/src/views/Moderation/Moderation.vue b/src/views/Moderation/Moderation.vue index 8224aa5c..7fef90b0 100644 --- a/src/views/Moderation/Moderation.vue +++ b/src/views/Moderation/Moderation.vue @@ -98,7 +98,7 @@ import { storeToRefs } from 'pinia'; import { playerModerationRequest } from '../../api'; import configRepository from '../../service/config.js'; - import { useUiStore, useModerationStore, useUserStore, useAppearanceSettingsStore } from '../../stores'; + import { useUiStore, useModerationStore, useUserStore } from '../../stores'; import { moderationTypes } from '../../shared/constants'; import { formatDateFilter } from '../../shared/utils';