mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Client Fixes Oct 1 (#9126)
* fix exp notifications for armoire * open the profile modal only if data is available
This commit is contained in:
@@ -30,4 +30,23 @@ export function getDropClass ({type, key}) {
|
||||
}
|
||||
|
||||
return dropClass;
|
||||
}
|
||||
|
||||
export function getSign (number) {
|
||||
let sign = '+';
|
||||
|
||||
if (number && number < 0) {
|
||||
sign = '-';
|
||||
}
|
||||
|
||||
return sign;
|
||||
}
|
||||
|
||||
export function round (number, nDigits) {
|
||||
return Math.abs(number.toFixed(nDigits || 1));
|
||||
}
|
||||
|
||||
export function getXPMessage (val) {
|
||||
if (val < -50) return; // don't show when they level up (resetting their exp)
|
||||
return `${getSign(val)} ${round(val)}`;
|
||||
}
|
||||
Reference in New Issue
Block a user