favicon and some TODOs
This commit is contained in:
@@ -46,7 +46,21 @@ export class Store {
|
||||
this.update({ extraExcludedDays: Math.max(0, Math.floor(count) || 0) });
|
||||
}
|
||||
|
||||
setActualMealBlocks(value: number | null): void {
|
||||
this.update({ actualMealBlocks: normalizeBalance(value) });
|
||||
}
|
||||
|
||||
setActualFlexDollars(value: number | null): void {
|
||||
this.update({ actualFlexDollars: normalizeBalance(value) });
|
||||
}
|
||||
|
||||
private emit(): void {
|
||||
for (const l of this.listeners) l();
|
||||
}
|
||||
}
|
||||
|
||||
/** Clamp an entered balance to a non-negative number, or null if blank/invalid. */
|
||||
function normalizeBalance(value: number | null): number | null {
|
||||
if (value === null || !Number.isFinite(value)) return null;
|
||||
return Math.max(0, value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user