Skip to content

Commit

Permalink
Merge branch 'master' into relaychart
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jun 20, 2024
2 parents f745e50 + 53a1638 commit 8a5d42e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/security/src/main/EmailChange.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ${trans.common_orPaste.txt()}
_ <- userRepo.setEmail(userId, email).recoverDefault
me <- userRepo.me(userId)
yield
logger.info(s"Set email for $id: $email")
logger.info(s"Change email for $userId: $previous -> $email")
me.map(_ -> previous)
}

Expand Down
12 changes: 9 additions & 3 deletions ui/puzzle/src/autoShape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { NormalMove } from 'chessops/types';

interface Opts {
node: Tree.Node;
nodeList: Tree.Node[];
showComputer(): boolean;
ceval: CevalCtrl;
ground: CgApi;
Expand Down Expand Up @@ -71,15 +72,20 @@ export default function (opts: Opts): DrawShape[] {
});
} else shapes = shapes.concat(makeAutoShapesFromUci(opposite(color), n.threat.pvs[0].moves[0], 'red'));
}
const feedback = feedbackAnnotation(n, opts.nodeList[opts.nodeList.length - 2]);
return shapes.concat(annotationShapes(n)).concat(feedback ? annotationShapes(feedback) : []);
}

function feedbackAnnotation(n: Tree.Node, prev?: Tree.Node): Tree.Node | undefined {
let glyph: Tree.Glyph | undefined;
switch (n.puzzle) {
const node = n.puzzle ? n : prev?.puzzle ? prev : undefined;
switch (node?.puzzle) {
case 'good':
case 'win':
glyph = { id: 7, name: 'good', symbol: '✓' };
break;
case 'fail':
glyph = { id: 4, name: 'fail', symbol: '✗' };
}
const withPuzzleGlyphs = glyph ? { ...n, glyphs: [glyph] } : n;
return shapes.concat(annotationShapes(withPuzzleGlyphs));
return node && glyph && { ...node, glyphs: [glyph] };
}
3 changes: 2 additions & 1 deletion ui/puzzle/src/ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ export default class PuzzleCtrl implements ParentCtrl {
this.withGround(g => g.playPremove());

const progress = moveTest(this);
this.setAutoShapes();
if (progress === 'fail') site.sound.say('incorrect');
if (progress) this.applyProgress(progress);
this.reorderChildren(path);
Expand Down Expand Up @@ -349,7 +350,7 @@ export default class PuzzleCtrl implements ParentCtrl {

revertUserMove = (): void => {
if (site.blindMode) this.instantRevertUserMove();
else setTimeout(this.instantRevertUserMove, 100);
else setTimeout(this.instantRevertUserMove, 300);
};

applyProgress = (progress: undefined | 'fail' | 'win' | MoveTest): void => {
Expand Down

0 comments on commit 8a5d42e

Please sign in to comment.