Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions ui/coordinateTrainer/src/ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,7 @@ export default class CoordinateTrainerCtrl {

advanceCoordinates = () => {
this.currentKey = this.nextKey;
if (this.selectionEnabled() === true)
this.nextKey = newKey(this.nextKey, this.selectedFiles, this.selectedRanks);
if (this.selectionEnabled()) this.nextKey = newKey(this.nextKey, this.selectedFiles, this.selectedRanks);
else this.nextKey = newKey(this.nextKey);

if (this.mode() === 'nameSquare')
Expand Down
2 changes: 1 addition & 1 deletion ui/round/src/crazy/crazyCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function valid(data: RoundData, role: Role, key: Key): boolean {

const drops = dropStr.match(/.{2}/g);

return drops?.includes(key) === true;
return !!drops?.includes(key);
}

export function onEnd(): void {
Expand Down
2 changes: 1 addition & 1 deletion ui/round/src/ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ export default class RoundController implements MoveRootCtrl {

rematch(accept?: boolean): boolean {
if (accept === undefined)
return this.data.opponent.offeringRematch === true || this.data.player.offeringRematch === true;
return !!this.data.opponent.offeringRematch || !!this.data.player.offeringRematch;
else if (accept) {
if (this.data.game.rematch) location.href = gameRoute(this.data.game.rematch, this.data.opponent.color);
if (!game.rematchable(this.data)) return false;
Expand Down
5 changes: 2 additions & 3 deletions ui/swiss/src/view/standing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ function playerTr(ctrl: SwissCtrl, player: Player) {
: p == 'late'
? h(p, title('Late'), '½')
: h(
'a.glpt.' +
(p.o ? 'ongoing' : p.w === true ? 'win' : p.w === false ? 'loss' : 'draw'),
'a.glpt.' + (p.o ? 'ongoing' : !!p.w ? 'win' : p.w === false ? 'loss' : 'draw'),
{ attrs: { key: p.g, href: `/${p.g}` }, hook: onInsert(site.powertip.manualGame) },
p.o ? '*' : p.w === true ? '1' : p.w === false ? '0' : '½',
p.o ? '*' : !!p.w ? '1' : p.w === false ? '0' : '½',
),
)
.concat([...Array(Math.max(0, ctrl.data.nbRounds - player.sheet.length))].map(_ => h('r'))),
Expand Down
2 changes: 1 addition & 1 deletion ui/voice/makeGrammar.mts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function findTransforms(
function validOps(h: string, x: string, pos: number, mode: SubRestriction) {
const validOps: { hnext: string; op: Transform | 'skip' }[] = [];
if (h[pos] === x[pos]) validOps.push({ hnext: h, op: 'skip' });
const minSlice = mode.del !== true || validOps.length > 0 ? 1 : 0;
const minSlice = !mode.del || validOps.length > 0 ? 1 : 0;
let slen = Math.min(mode.sub ?? 0, x.length - pos);
while (slen >= minSlice) {
const slice = x.slice(pos, pos + slen);
Expand Down
2 changes: 1 addition & 1 deletion ui/voice/src/mic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class Mic implements Microphone {
return;
}
const recId = also.recId ?? 'default';
const rec = new RecNode(words.slice(), also.partial === true);
const rec = new RecNode(words.slice(), !!also.partial);
if (this.vosk?.isLoaded(this.lang)) this.initKaldi(recId, rec);
this.recs.add(recId, rec);
if (also.listener) this.addListener(also.listener, { recId, listenerId: also.listenerId });
Expand Down
2 changes: 1 addition & 1 deletion ui/voice/src/move/voice.move.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export function initModule({

function initDefaultRec() {
const excludeTag = root?.vote ? 'round' : 'puzzle'; // reduce unneeded vocabulary
const words = tagWords().filter(x => byWord.get(x)?.tags?.includes(excludeTag) !== true);
const words = tagWords().filter(x => !byWord.get(x)?.tags?.includes(excludeTag));
voice.mic.initRecognizer(words, { listener: listen });
}

Expand Down
2 changes: 1 addition & 1 deletion ui/voice/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function findTransforms(
function validOps(h: string, x: string, pos: number) {
const validOps: { hnext: string; op: Transform | 'skip' }[] = [];
if (h[pos] === x[pos]) validOps.push({ hnext: h, op: 'skip' });
const minSlice = mode.del !== true || validOps.length > 0 ? 1 : 0;
const minSlice = !mode.del || validOps.length > 0 ? 1 : 0;
let slen = Math.min(mode.sub ?? 0, x.length - pos);
while (slen >= minSlice) {
const slice = x.slice(pos, pos + slen);
Expand Down