projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adjustments. Still issues with arrows out of board
[vchess.git]
/
server
/
models
/
Game.js
diff --git
a/server/models/Game.js
b/server/models/Game.js
index
401e365
..
1d2cd68
100644
(file)
--- a/
server/models/Game.js
+++ b/
server/models/Game.js
@@
-128,12
+128,13
@@
const GameModel =
db.serialize(function() {
let query =
"SELECT id, vid, cadence, created, score, white, black " +
db.serialize(function() {
let query =
"SELECT id, vid, cadence, created, score, white, black " +
- "FROM Games ";
- if (uid > 0) query +=
- "WHERE " +
- " created < " + cursor + " AND " +
- " white <> " + uid + " AND " +
- " black <> " + uid + " ";
+ "FROM Games " +
+ "WHERE created < " + cursor + " ";
+ if (uid > 0) {
+ query +=
+ " AND white <> " + uid + " " +
+ " AND black <> " + uid + " ";
+ }
query +=
"ORDER BY created DESC " +
"LIMIT 20"; //TODO: 20 hard-coded...
query +=
"ORDER BY created DESC " +
"LIMIT 20"; //TODO: 20 hard-coded...