Skip to content

Commit

Permalink
chore: lint files
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeg committed Oct 13, 2024
1 parent cdbf079 commit 06e9b2f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 34 deletions.
63 changes: 34 additions & 29 deletions public/views/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -1271,38 +1271,43 @@ export default class Player extends EventTarget {
: this.options.srabbit_playout_length,
};

this.stackRabbitWorker.rpc('rateMove', moveParams).then(ratings => {
const { playerMoveAfterAdjustment, bestMoveAfterAdjustment } =
ratings;
let grade = null;

if (playerMoveAfterAdjustment >= bestMoveAfterAdjustment - 1) {
grade = 4;
} else if (playerMoveAfterAdjustment >= bestMoveAfterAdjustment - 3) {
grade = 3;
} else if (
playerMoveAfterAdjustment >=
bestMoveAfterAdjustment - 6
) {
grade = 2;
} else if (
playerMoveAfterAdjustment >=
bestMoveAfterAdjustment - 15
) {
grade = 1;
}
else {
grade = 0;
}

this.onMoveRating({ params: moveParams, ratings, grade });
}).catch(err => {
console.error(err);
})
this.stackRabbitWorker
.rpc('rateMove', moveParams)
.then(ratings => {
const { playerMoveAfterAdjustment, bestMoveAfterAdjustment } =
ratings;
let grade = null;

if (playerMoveAfterAdjustment >= bestMoveAfterAdjustment - 1) {
grade = 4;
} else if (
playerMoveAfterAdjustment >=
bestMoveAfterAdjustment - 3
) {
grade = 3;
} else if (
playerMoveAfterAdjustment >=
bestMoveAfterAdjustment - 6
) {
grade = 2;
} else if (
playerMoveAfterAdjustment >=
bestMoveAfterAdjustment - 15
) {
grade = 1;
} else {
grade = 0;
}

this.onMoveRating({ params: moveParams, ratings, grade });
})
.catch(err => {
console.error(err);
});
})
.catch(err => {
console.error(err);
})
});
}

this.dom.drought.textContent = this.options.format_drought(
Expand Down
6 changes: 1 addition & 5 deletions public/views/mp/ctwc23.html
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,7 @@
<br />
<br />
<br />
<img
src="/images/ctwc_columbia.webp"
style="max-width: 260px"
/>
<img src="/images/ctwc_columbia.webp" style="max-width: 260px" />
<br />
<br />
<br />
Expand Down Expand Up @@ -654,7 +651,6 @@
import Competition from '/views/competition.js';
import InvisibleMixin from '/views/InvisibleMixin.js';
import { easeOutElastic, getRandomAngle } from '/js/anim.js';


if (/^[1234]$/.test(QueryString.get('heartpos'))) {
document
Expand Down

0 comments on commit 06e9b2f

Please sign in to comment.