improve gamelog and prev info performance

This commit is contained in:
pa
2026-01-09 22:28:26 +09:00
committed by Natsumi
parent 97a0cddf68
commit 937294ebf7
3 changed files with 27 additions and 14 deletions

View File

@@ -94,7 +94,10 @@ export const useGameLogStore = defineStore('GameLog', () => {
gameLogTable.value.data.length = 0;
gameLogSessionTable.value = [];
if (isLoggedIn) {
initGameLogTable();
// wait for friends to load, silly but works
setTimeout(() => {
initGameLogTable();
}, 800);
}
},
{ flush: 'sync' }
@@ -342,11 +345,18 @@ export const useGameLogStore = defineStore('GameLog', () => {
gameLogTable.value.filter,
vipList
);
for (const row of rows) {
row.isFriend = gameLogIsFriend(row);
row.isFavorite = gameLogIsFavorite(row);
}
gameLogTable.value.data = shallowReactive(rows);
gameLogTable.value.loading = false;
}
function addGameLog(entry) {
entry.isFriend = gameLogIsFriend(entry);
entry.isFavorite = gameLogIsFavorite(entry);
gameLogSessionTable.value.push(entry);
sweepGameLogSessionTable();
sharedFeedStore.updateSharedFeed(false);
@@ -386,10 +396,7 @@ export const useGameLogStore = defineStore('GameLog', () => {
if (!gameLogSearch(entry)) {
return;
}
gameLogTable.value.data.push({
...entry,
uid: crypto.randomUUID()
});
gameLogTable.value.data.push(entry);
sweepGameLog();
uiStore.notifyMenu('game-log');
}
@@ -1428,6 +1435,10 @@ export const useGameLogStore = defineStore('GameLog', () => {
gameLogTable.value.search,
gameLogTable.value.filter
);
for (const row of rows) {
row.isFriend = gameLogIsFriend(row);
row.isFavorite = gameLogIsFavorite(row);
}
gameLogTable.value.data = shallowReactive(rows);
}