projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Eightpieces almost ready
[vchess.git]
/
client
/
src
/
components
/
GameList.vue
diff --git
a/client/src/components/GameList.vue
b/client/src/components/GameList.vue
index
7160202
..
354cfa0
100644
(file)
--- a/
client/src/components/GameList.vue
+++ b/
client/src/components/GameList.vue
@@
-57,12
+57,19
@@
export default {
// Show in order: it's my turn, running games, completed games
let minCreated = Number.MAX_SAFE_INTEGER;
let maxCreated = 0;
// Show in order: it's my turn, running games, completed games
let minCreated = Number.MAX_SAFE_INTEGER;
let maxCreated = 0;
- this.games.forEach(g => {
+ let remGames = this.games.filter(g => !this.deleted[g.id]);
+ remGames.forEach(g => {
if (g.created < minCreated) minCreated = g.created;
if (g.created > maxCreated) maxCreated = g.created;
if (g.created < minCreated) minCreated = g.created;
if (g.created > maxCreated) maxCreated = g.created;
+ g.priority = 0;
+ if (g.score == "*") {
+ g.priority++;
+ if (!!g.myColor) g.priority++;
+ if (!!g.myTurn) g.priority++;
+ }
});
const deltaCreated = maxCreated - minCreated;
});
const deltaCreated = maxCreated - minCreated;
- return
this.g
ames.sort((g1, g2) => {
+ return
remG
ames.sort((g1, g2) => {
return (
g2.priority - g1.priority + (g2.created - g1.created) / deltaCreated
);
return (
g2.priority - g1.priority + (g2.created - g1.created) / deltaCreated
);