mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 06:46:04 +02:00
improve gamelog and prev info performance
This commit is contained in:
@@ -28,8 +28,8 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="t('table.gameLog.icon')" prop="isFriend" width="70" align="center">
|
<el-table-column :label="t('table.gameLog.icon')" prop="isFriend" width="70" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<template v-if="gameLogIsFriend(scope.row)">
|
<template v-if="scope.row?.isFriend">
|
||||||
<TooltipWrapper v-if="gameLogIsFavorite(scope.row)" side="top" content="Favorite">
|
<TooltipWrapper v-if="scope.row?.isFavorite" side="top" content="Favorite">
|
||||||
<span>⭐</span>
|
<span>⭐</span>
|
||||||
</TooltipWrapper>
|
</TooltipWrapper>
|
||||||
<TooltipWrapper v-else side="top" content="Friend">
|
<TooltipWrapper v-else side="top" content="Friend">
|
||||||
@@ -146,6 +146,8 @@
|
|||||||
const array = [];
|
const array = [];
|
||||||
for (const entry of Array.from(data.values())) {
|
for (const entry of Array.from(data.values())) {
|
||||||
entry.timer = timeToText(entry.time);
|
entry.timer = timeToText(entry.time);
|
||||||
|
entry.isFriend = gameLogIsFriend(entry);
|
||||||
|
entry.isFavorite = gameLogIsFavorite(entry);
|
||||||
array.push(entry);
|
array.push(entry);
|
||||||
}
|
}
|
||||||
array.sort(compareByCreatedAt);
|
array.sort(compareByCreatedAt);
|
||||||
|
|||||||
+15
-4
@@ -94,7 +94,10 @@ export const useGameLogStore = defineStore('GameLog', () => {
|
|||||||
gameLogTable.value.data.length = 0;
|
gameLogTable.value.data.length = 0;
|
||||||
gameLogSessionTable.value = [];
|
gameLogSessionTable.value = [];
|
||||||
if (isLoggedIn) {
|
if (isLoggedIn) {
|
||||||
|
// wait for friends to load, silly but works
|
||||||
|
setTimeout(() => {
|
||||||
initGameLogTable();
|
initGameLogTable();
|
||||||
|
}, 800);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ flush: 'sync' }
|
{ flush: 'sync' }
|
||||||
@@ -342,11 +345,18 @@ export const useGameLogStore = defineStore('GameLog', () => {
|
|||||||
gameLogTable.value.filter,
|
gameLogTable.value.filter,
|
||||||
vipList
|
vipList
|
||||||
);
|
);
|
||||||
|
|
||||||
|
for (const row of rows) {
|
||||||
|
row.isFriend = gameLogIsFriend(row);
|
||||||
|
row.isFavorite = gameLogIsFavorite(row);
|
||||||
|
}
|
||||||
gameLogTable.value.data = shallowReactive(rows);
|
gameLogTable.value.data = shallowReactive(rows);
|
||||||
gameLogTable.value.loading = false;
|
gameLogTable.value.loading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function addGameLog(entry) {
|
function addGameLog(entry) {
|
||||||
|
entry.isFriend = gameLogIsFriend(entry);
|
||||||
|
entry.isFavorite = gameLogIsFavorite(entry);
|
||||||
gameLogSessionTable.value.push(entry);
|
gameLogSessionTable.value.push(entry);
|
||||||
sweepGameLogSessionTable();
|
sweepGameLogSessionTable();
|
||||||
sharedFeedStore.updateSharedFeed(false);
|
sharedFeedStore.updateSharedFeed(false);
|
||||||
@@ -386,10 +396,7 @@ export const useGameLogStore = defineStore('GameLog', () => {
|
|||||||
if (!gameLogSearch(entry)) {
|
if (!gameLogSearch(entry)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gameLogTable.value.data.push({
|
gameLogTable.value.data.push(entry);
|
||||||
...entry,
|
|
||||||
uid: crypto.randomUUID()
|
|
||||||
});
|
|
||||||
sweepGameLog();
|
sweepGameLog();
|
||||||
uiStore.notifyMenu('game-log');
|
uiStore.notifyMenu('game-log');
|
||||||
}
|
}
|
||||||
@@ -1428,6 +1435,10 @@ export const useGameLogStore = defineStore('GameLog', () => {
|
|||||||
gameLogTable.value.search,
|
gameLogTable.value.search,
|
||||||
gameLogTable.value.filter
|
gameLogTable.value.filter
|
||||||
);
|
);
|
||||||
|
for (const row of rows) {
|
||||||
|
row.isFriend = gameLogIsFriend(row);
|
||||||
|
row.isFavorite = gameLogIsFavorite(row);
|
||||||
|
}
|
||||||
gameLogTable.value.data = shallowReactive(rows);
|
gameLogTable.value.data = shallowReactive(rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -116,6 +116,8 @@ export const createColumns = ({ getCreatedAt, onDelete, onDeletePrompt }) => {
|
|||||||
header: () => t('table.gameLog.user'),
|
header: () => t('table.gameLog.user'),
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
const original = row.original;
|
const original = row.original;
|
||||||
|
const isFriend = original.isFriend;
|
||||||
|
const isFavorite = original.isFavorite;
|
||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
{original.displayName ? (
|
{original.displayName ? (
|
||||||
@@ -126,10 +128,8 @@ export const createColumns = ({ getCreatedAt, onDelete, onDeletePrompt }) => {
|
|||||||
{original.displayName}
|
{original.displayName}
|
||||||
</span>
|
</span>
|
||||||
) : null}
|
) : null}
|
||||||
{gameLogIsFriend(original) ? (
|
{isFriend ? (
|
||||||
<span>
|
<span>{isFavorite ? '⭐' : '💚'}</span>
|
||||||
{gameLogIsFavorite(original) ? '⭐' : '💚'}
|
|
||||||
</span>
|
|
||||||
) : null}
|
) : null}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user