diff --git a/frontend/src/ts/elements/account-button.ts b/frontend/src/ts/elements/account-button.ts index c687dba24..ef0ca48da 100644 --- a/frontend/src/ts/elements/account-button.ts +++ b/frontend/src/ts/elements/account-button.ts @@ -143,7 +143,7 @@ export async function update( export async function updateXpBar( currentXp: number, addedXp: number, - breakdown: Record + breakdown?: Record ): Promise { skipBreakdown = false; const startingLevel = Misc.getLevel(currentXp); @@ -176,8 +176,12 @@ export async function updateXpBar( async function animateXpBreakdown( addedXp: number, - breakdown: Record + breakdown?: Record ): Promise { + if (!breakdown) { + $("#menu .xpBar .xpGain").text(`+${addedXp}`); + return; + } const delay = 1000; let total = 0; const xpGain = $("#menu .xpBar .xpGain");