projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix problems editing (hopefully)
[vchess.git]
/
client
/
src
/
views
/
Hall.vue
diff --git
a/client/src/views/Hall.vue
b/client/src/views/Hall.vue
index
a39cd54
..
4fb8e55
100644
(file)
--- a/
client/src/views/Hall.vue
+++ b/
client/src/views/Hall.vue
@@
-237,7
+237,6
@@
export default {
let names = {};
response.challenges.forEach(c => {
if (c.uid != this.st.user.id) names[c.uid] = "";
let names = {};
response.challenges.forEach(c => {
if (c.uid != this.st.user.id) names[c.uid] = "";
- //unknwon for now
else if (!!c.target && c.target != this.st.user.id)
names[c.target] = "";
});
else if (!!c.target && c.target != this.st.user.id)
names[c.target] = "";
});
@@
-799,9
+798,10
@@
export default {
// c.to == this.st.user.name (connected)
if (c.fen) {
const parsedFen = V.ParseFen(c.fen);
// c.to == this.st.user.name (connected)
if (c.fen) {
const parsedFen = V.ParseFen(c.fen);
+ c.mycolor = V.GetOppCol(parsedFen.turn);
this.tchallDiag = getDiagram({
position: parsedFen.position,
this.tchallDiag = getDiagram({
position: parsedFen.position,
- orientation:
V.GetOppCol(parsedFen.turn)
+ orientation:
c.mycolor
});
this.curChallToAccept = c;
document.getElementById("modalAccept").checked = true;
});
this.curChallToAccept = c;
document.getElementById("modalAccept").checked = true;
@@
-831,7
+831,10
@@
export default {
let gameInfo = {
id: getRandString(),
fen: c.fen || V.GenRandInitFen(),
let gameInfo = {
id: getRandString(),
fen: c.fen || V.GenRandInitFen(),
- players: shuffle([c.from, c.seat]), //white then black
+ // White player index 0, black player index 1:
+ players: c.mycolor
+ ? (c.mycolor == "w" ? [c.seat, c.from] : [c.from, c.seat])
+ : shuffle([c.from, c.seat]),
vid: c.vid,
cadence: c.cadence
};
vid: c.vid,
cadence: c.cadence
};