[Glitch] Use integers and not numbers in notification policy API counters
Port b4d991adaa
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
shrike
parent
c316852a65
commit
87b9b23025
|
@ -27,7 +27,7 @@ export const FilteredNotificationsBanner = () => {
|
||||||
};
|
};
|
||||||
}, [dispatch]);
|
}, [dispatch]);
|
||||||
|
|
||||||
if (policy === null || policy.getIn(['summary', 'pending_notifications_count']) * 1 === 0) {
|
if (policy === null || policy.getIn(['summary', 'pending_notifications_count']) === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,10 +70,10 @@ export function roundTo10(num: number): number {
|
||||||
return Math.round(num * 0.1) / 0.1;
|
return Math.round(num * 0.1) / 0.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function toCappedNumber(num: string): string {
|
export function toCappedNumber(num: number, max = 99): string {
|
||||||
if (parseInt(num) > 99) {
|
if (num > max) {
|
||||||
return '99+';
|
return `${max}+`;
|
||||||
} else {
|
} else {
|
||||||
return num;
|
return num.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue