mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Fix deleting moderations and default table sorting
This commit is contained in:
@@ -63,10 +63,6 @@
|
|||||||
layout: {
|
layout: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'table, pagination'
|
default: 'table, pagination'
|
||||||
},
|
|
||||||
defaultSort: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({ prop: 'created_at', order: 'descending' })
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
emits: [
|
emits: [
|
||||||
@@ -84,8 +80,8 @@
|
|||||||
const internalCurrentPage = ref(currentPage.value);
|
const internalCurrentPage = ref(currentPage.value);
|
||||||
const internalPageSize = ref(pageSize.value);
|
const internalPageSize = ref(pageSize.value);
|
||||||
const sortData = ref({
|
const sortData = ref({
|
||||||
prop: props.defaultSort?.prop || null,
|
prop: props.tableProps.defaultSort?.prop || 'created_at',
|
||||||
order: props.defaultSort?.order || null
|
order: props.tableProps.defaultSort?.order || 'descending'
|
||||||
});
|
});
|
||||||
|
|
||||||
const showPagination = computed(() => {
|
const showPagination = computed(() => {
|
||||||
@@ -201,7 +197,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.defaultSort,
|
() => props.tableProps.defaultSort,
|
||||||
(newSort) => {
|
(newSort) => {
|
||||||
if (newSort) {
|
if (newSort) {
|
||||||
sortData.value = {
|
sortData.value = {
|
||||||
|
|||||||
@@ -80,6 +80,15 @@ export const useModerationStore = defineStore('Moderation', () => {
|
|||||||
userRef.$moderations = getUserModerations(ref.targetUserId);
|
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;
|
const D = userStore.userDialog;
|
||||||
if (
|
if (
|
||||||
D.visible === false ||
|
D.visible === false ||
|
||||||
@@ -99,15 +108,6 @@ export const useModerationStore = defineStore('Moderation', () => {
|
|||||||
} else if (ref.type === 'muteChat') {
|
} else if (ref.type === 'muteChat') {
|
||||||
D.isMuteChat = false;
|
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) {
|
function handlePlayerModerationDelete(args) {
|
||||||
|
|||||||
@@ -98,7 +98,7 @@
|
|||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { playerModerationRequest } from '../../api';
|
import { playerModerationRequest } from '../../api';
|
||||||
import configRepository from '../../service/config.js';
|
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 { moderationTypes } from '../../shared/constants';
|
||||||
import { formatDateFilter } from '../../shared/utils';
|
import { formatDateFilter } from '../../shared/utils';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user