Skip to content

Commit cfff712

Browse files
fix(xp-bar): don't show attribute if it's 0 (@jackrosenberg) (monkeytypegame#6664)
Only show accPenalty if it's relevant. Still need to build and test :) ### Description <!-- Please describe the change(s) made in your PR --> ### Checks - [ ] Adding quotes? - [ ] Make sure to include translations for the quotes in the description (or another comment) so we can verify their content. - [ ] Adding a language? - Make sure to follow the [languages documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LANGUAGES.md) - [ ] Add language to `packages/contracts/src/schemas/languages.ts` - [ ] Add language to exactly one group in `frontend/src/ts/constants/languages.ts` - [ ] Add language json file to `frontend/static/languages` - [ ] Adding a theme? - Make sure to follow the [themes documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/THEMES.md) - [ ] Add theme to `packages/contracts/src/schemas/themes.ts` - [ ] Add theme to `frontend/src/ts/constants/themes.ts` - [ ] Add theme css file to `frontend/static/themes` - Also please add a screenshot of the theme, it would be extra awesome if you do so! - [ ] Adding a layout? - [ ] Make sure to follow the [layouts documentation](https://github.com/monkeytypegame/monkeytype/blob/master/docs/LAYOUTS.md) - [ ] Add layout to `packages/contracts/src/schemas/layouts.ts` - [ ] Add layout json file to `frontend/static/layouts` - [x] Check if any open issues are related to this PR; if so, be sure to tag them below. - [x] Make sure the PR title follows the Conventional Commits standard. (https://www.conventionalcommits.org for more info) - [x] Make sure to include your GitHub username prefixed with @ inside parentheses at the end of the PR title. <!-- label(optional scope): pull request title (@your_github_username) --> <!-- I know I know they seem boring but please do them, they help us and you will find out it also helps you.--> Closes # <!-- the issue(s) your PR resolves if any (delete if that is not the case) --> <!-- please also reference any issues and or PRs related to your pull request --> <!-- Also remove it if you are not following any issues. --> <!-- pro tip: you can mention an issue, PR, or discussion on GitHub by referencing its hash number e.g: [monkeytypegame#1234](monkeytypegame#1234) --> <!-- pro tip: you can press . (dot or period) in the code tab of any GitHub repo to get access to GitHub's VS Code web editor Enjoy! :) -->
1 parent 4a4a6ab commit cfff712

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

frontend/src/ts/elements/xp-bar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ async function animateXpBreakdown(
322322

323323
if (skip) return;
324324

325-
if (isSafeNumber(breakdown.accPenalty)) {
325+
if (isSafeNumber(breakdown.accPenalty) && breakdown.accPenalty > 0) {
326326
await Misc.sleep(delay);
327327
total -= breakdown.accPenalty;
328328
void flashTotalXp(total);
@@ -331,7 +331,7 @@ async function animateXpBreakdown(
331331

332332
if (skip) return;
333333

334-
if (isSafeNumber(breakdown.incomplete)) {
334+
if (isSafeNumber(breakdown.incomplete) && breakdown.incomplete > 0) {
335335
await Misc.sleep(delay);
336336
total += breakdown.incomplete;
337337
void flashTotalXp(total);

0 commit comments

Comments
 (0)