Kantongku: guard target nominal 0 (edge case backup)

This commit is contained in:
Bro
2026-08-16 21:01:16 +07:00
parent def45e9e5b
commit a627d5bccc
+4 -1
View File
@@ -176,7 +176,10 @@ export function SavingsScreen() {
</View> </View>
) : ( ) : (
targets.map((target) => { targets.map((target) => {
const pct = Math.min(100, Math.round((total / target.targetAmount) * 100)); const pct =
target.targetAmount > 0
? Math.min(100, Math.round((total / target.targetAmount) * 100))
: 0;
const remaining = Math.max(0, target.targetAmount - total); const remaining = Math.max(0, target.targetAmount - total);
const now = new Date(); const now = new Date();
const dayOfMonth = now.getDate(); const dayOfMonth = now.getDate();