Fix table sorting bug

This commit is contained in:
Natsumi
2024-07-29 04:26:07 +12:00
parent 749f5355e2
commit 181c8feb4a
5 changed files with 26 additions and 6 deletions

View File

@@ -5216,6 +5216,7 @@ speechSynthesis.getVoices();
case 'content-refresh':
var contentType = content.contentType;
console.log('content-refresh', content);
if (contentType === 'icon') {
if ($app.galleryDialogVisible) {
$app.refreshVRCPlusIconsTable();
@@ -5232,6 +5233,8 @@ speechSynthesis.getVoices();
// hmm, utilizing this might be too spamy and cause UI to move around
} else if (contentType === 'world') {
// hmm
} else if (contentType === 'created') {
// on avatar upload
} else {
console.log('Unknown content-refresh', content);
}
@@ -8018,6 +8021,24 @@ speechSynthesis.getVoices();
if (index === 'notification') {
this.unseenNotifications = [];
}
workerTimers.setTimeout(() => {
// fix some weird sorting bug when disabling data tables
if (
typeof this.$refs.playerModerationTableRef?.sortData !==
'undefined'
) {
this.$refs.playerModerationTableRef.sortData.prop = 'created';
}
if (
typeof this.$refs.notificationTableRef?.sortData !== 'undefined'
) {
this.$refs.notificationTableRef.sortData.prop = 'created_at';
}
if (typeof this.$refs.friendLogTableRef?.sortData !== 'undefined') {
this.$refs.friendLogTableRef.sortData.prop = 'created_at';
}
}, 100);
};
$app.data.twoFactorAuthDialogVisible = false;
@@ -30659,7 +30680,6 @@ speechSynthesis.getVoices();
});
var ref = API.applyGroup(args.json);
API.currentUserGroups.set(groupId, ref);
console.log(`Fetched group ${ref.name}`);
} catch (err) {
console.error(err);
}

View File

@@ -80,7 +80,7 @@ mixin feedTab()
el-table-column(:label="$t('table.feed.type')" prop="type" width="70")
el-table-column(:label="$t('table.feed.user')" prop="displayName" width="180")
template(v-once #default="scope")
span.x-link(v-text="scope.row.displayName" @click="showUserDialog(scope.row.userId)")
span.x-link(v-text="scope.row.displayName" @click="showUserDialog(scope.row.userId)" style="padding-right:10px")
el-table-column(:label="$t('table.feed.detail')")
template(v-once #default="scope")
template(v-if="scope.row.type === 'GPS'")

View File

@@ -1,6 +1,6 @@
mixin friendLogTab()
.x-container(v-show="$refs.menu && $refs.menu.activeIndex === 'friendLog'" v-if="$refs.menu && $refs.menu.activeIndex === 'friendLog'")
data-tables(v-bind="friendLogTable")
data-tables(v-bind="friendLogTable" ref="friendLogTableRef")
template(#tool)
div(style="margin:0 0 10px;display:flex;align-items:center")
el-select(v-model="friendLogTable.filters[0].value" @change="saveTableFilters" multiple clearable collapse-tags style="flex:1" :placeholder="$t('view.friend_log.filter_placeholder')")
@@ -16,7 +16,7 @@ mixin friendLogTab()
el-table-column(:label="$t('table.friendLog.user')" prop="displayName")
template(v-once #default="scope")
span(v-if="scope.row.type === 'DisplayName'") {{ scope.row.previousDisplayName }} #[i.el-icon-right] 
span.x-link(v-text="scope.row.displayName || scope.row.userId" @click="showUserDialog(scope.row.userId)")
span.x-link(v-text="scope.row.displayName || scope.row.userId" @click="showUserDialog(scope.row.userId)" style="padding-right:10px")
template(v-if="scope.row.type === 'TrustLevel'")
span ({{ scope.row.previousTrustLevel }} #[i.el-icon-right] {{ scope.row.trustLevel }})
el-table-column(:label="$t('table.friendLog.action')" width="80" align="right")

View File

@@ -1,6 +1,6 @@
mixin moderationTab()
.x-container(v-show="$refs.menu && $refs.menu.activeIndex === 'moderation'" v-if="$refs.menu && $refs.menu.activeIndex === 'moderation'")
data-tables(v-bind="playerModerationTable" v-loading="API.isPlayerModerationsLoading")
data-tables(v-bind="playerModerationTable" ref="playerModerationTableRef" v-loading="API.isPlayerModerationsLoading")
template(#tool)
div(style="margin:0 0 10px;display:flex;align-items:center")
el-select(v-model="playerModerationTable.filters[0].value" @change="saveTableFilters" multiple clearable collapse-tags style="flex:1" :placeholder="$t('view.moderation.filter_placeholder')")

View File

@@ -1,6 +1,6 @@
mixin notificationsTab()
.x-container(v-show="$refs.menu && $refs.menu.activeIndex === 'notification'" v-if="$refs.menu && $refs.menu.activeIndex === 'notification'" v-loading="API.isNotificationsLoading")
data-tables(v-bind="notificationTable" class="notification-table")
data-tables(v-bind="notificationTable" ref="notificationTableRef" class="notification-table")
template(#tool)
div(style="margin:0 0 10px;display:flex;align-items:center")
el-select(v-model="notificationTable.filters[0].value" @change="saveTableFilters" multiple clearable collapse-tags style="flex:1" :placeholder="$t('view.notification.filter_placeholder')")