mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 14:56:06 +02:00
Fix playerlist table size changing when current instance empty
This commit is contained in:
+20
-15
@@ -1,4 +1,4 @@
|
|||||||
import { reactive, ref, watch } from 'vue';
|
import { reactive, watch, ref, computed } from 'vue';
|
||||||
import { ElMessage } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
@@ -81,23 +81,28 @@ export const useInstanceStore = defineStore('Instance', () => {
|
|||||||
|
|
||||||
const instanceJoinHistory = ref(new Map());
|
const instanceJoinHistory = ref(new Map());
|
||||||
|
|
||||||
const currentInstanceUserList = ref({
|
const currentInstanceUsersData = ref([]);
|
||||||
data: [],
|
const currentInstanceUsersTable = computed(() => {
|
||||||
tableProps: {
|
return reactive({
|
||||||
stripe: true,
|
data: currentInstanceWorld.value.ref.id
|
||||||
size: 'small',
|
? currentInstanceUsersData.value
|
||||||
defaultSort: {
|
: [],
|
||||||
prop: 'timer',
|
tableProps: {
|
||||||
order: 'descending'
|
stripe: true,
|
||||||
}
|
size: 'small',
|
||||||
},
|
defaultSort: {
|
||||||
layout: 'table'
|
prop: 'timer',
|
||||||
|
order: 'descending'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
layout: 'table'
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => watchState.isLoggedIn,
|
() => watchState.isLoggedIn,
|
||||||
(isLoggedIn) => {
|
(isLoggedIn) => {
|
||||||
currentInstanceUserList.value.data = [];
|
currentInstanceUsersTable.value.data = [];
|
||||||
instanceJoinHistory.value = new Map();
|
instanceJoinHistory.value = new Map();
|
||||||
previousInstancesInfoDialogVisible.value = false;
|
previousInstancesInfoDialogVisible.value = false;
|
||||||
cachedInstances.clear();
|
cachedInstances.clear();
|
||||||
@@ -1188,7 +1193,7 @@ export const useInstanceStore = defineStore('Instance', () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
currentInstanceUserList.value.data = users;
|
currentInstanceUsersTable.value.data = users;
|
||||||
}
|
}
|
||||||
|
|
||||||
// $app.methods.instanceQueueClear = function () {
|
// $app.methods.instanceQueueClear = function () {
|
||||||
@@ -1210,7 +1215,7 @@ export const useInstanceStore = defineStore('Instance', () => {
|
|||||||
previousInstancesInfoDialogVisible,
|
previousInstancesInfoDialogVisible,
|
||||||
previousInstancesInfoDialogInstanceId,
|
previousInstancesInfoDialogInstanceId,
|
||||||
instanceJoinHistory,
|
instanceJoinHistory,
|
||||||
currentInstanceUserList,
|
currentInstanceUsersTable,
|
||||||
|
|
||||||
applyInstance,
|
applyInstance,
|
||||||
updateCurrentInstanceWorld,
|
updateCurrentInstanceWorld,
|
||||||
|
|||||||
@@ -189,7 +189,7 @@
|
|||||||
|
|
||||||
<div class="current-instance-table">
|
<div class="current-instance-table">
|
||||||
<DataTable
|
<DataTable
|
||||||
v-bind="currentInstanceWorld.ref.id ? currentInstanceUserList : {}"
|
v-bind="currentInstanceUsersTable"
|
||||||
style="margin-top: 10px; cursor: pointer"
|
style="margin-top: 10px; cursor: pointer"
|
||||||
@row-click="selectCurrentInstanceRow">
|
@row-click="selectCurrentInstanceRow">
|
||||||
<el-table-column :label="t('table.playerList.avatar')" width="70" prop="photo">
|
<el-table-column :label="t('table.playerList.avatar')" width="70" prop="photo">
|
||||||
@@ -439,7 +439,7 @@
|
|||||||
const { showWorldDialog } = useWorldStore();
|
const { showWorldDialog } = useWorldStore();
|
||||||
const { lastLocation } = storeToRefs(useLocationStore());
|
const { lastLocation } = storeToRefs(useLocationStore());
|
||||||
const { currentInstanceLocation, currentInstanceWorld } = storeToRefs(useInstanceStore());
|
const { currentInstanceLocation, currentInstanceWorld } = storeToRefs(useInstanceStore());
|
||||||
const { currentInstanceUserList, getCurrentInstanceUserList } = useInstanceStore();
|
const { currentInstanceUsersTable, getCurrentInstanceUserList } = useInstanceStore();
|
||||||
const { menuActiveIndex } = storeToRefs(useUiStore());
|
const { menuActiveIndex } = storeToRefs(useUiStore());
|
||||||
const { showFullscreenImageDialog } = useGalleryStore();
|
const { showFullscreenImageDialog } = useGalleryStore();
|
||||||
const { currentUser } = storeToRefs(useUserStore());
|
const { currentUser } = storeToRefs(useUserStore());
|
||||||
|
|||||||
Reference in New Issue
Block a user