Skip to content

Commit 28ff68a

Browse files
committed
fix: donations sum, gallery indicators
1 parent 3ff2d7f commit 28ff68a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/app/gallery/gallery.component.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
cursor: pointer;
4444
border: 1px solid #fff;
4545
margin: 0 4px;
46+
display: block;
4647

4748
&.active {
4849
background: #fff;

src/app/index/donate/donate.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class IndexDonateComponent {
3535
sum: d.sum / 100,
3636
}));
3737
const charges = operations.filter((d) => d.sum < 0);
38-
const totalChargesSum = charges.reduce((sum, d) => sum + d.sum * rates[d.currency], 0);
38+
const totalChargesSum = charges.reduce((sum, d) => sum + (d.sum * rates[d.currency]) / 100, 0);
3939
const totalDonationsSum = donations.reduce((sum, d) => sum + d.sum * rates[d.currency], 0);
4040

4141
const total = Math.max(-totalChargesSum + this.monthlyCharge, totalDonationsSum);
@@ -44,9 +44,9 @@ export class IndexDonateComponent {
4444
charges: charges.map((o) => ({
4545
currency: o.currency,
4646
date: o.date,
47-
percent: (-100 * o.sum * rates[o.currency]) / total,
47+
percent: (-100 * o.sum * rates[o.currency]) / 100 / total,
4848
purpose: o.purpose,
49-
sum: o.sum,
49+
sum: o.sum / 100,
5050
})),
5151
donations: donations.map((o) => ({
5252
contributor: o.contributor,

0 commit comments

Comments
 (0)