Skip to content

Commit a11d106

Browse files
author
Christian Bedon
committed
fix: paying back delinquent case was already handled with paying back status
1 parent a444acb commit a11d106

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

src/components/MyKiva/BorrowerCarousel.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ const VALID_LOAN_STATUS = [
205205
];
206206
207207
const activeLoans = computed(() => {
208-
return loans.value.filter(l => VALID_LOAN_STATUS.includes(l?.status) || l?.delinquent);
208+
return loans.value.filter(l => VALID_LOAN_STATUS.includes(l?.status));
209209
});
210210
211211
const hasActiveLoans = computed(() => activeLoans.value.length > 0);
@@ -219,7 +219,7 @@ const title = computed(() => {
219219
220220
const filteredLoans = computed(() => {
221221
return loans.value.filter(loan => VALID_LOAN_STATUS
222-
.includes(loan?.status) || loan?.delinquent).slice(0, props.cardsNumber);
222+
.includes(loan?.status)).slice(0, props.cardsNumber);
223223
});
224224
225225
const inPfp = computed(() => sharedLoan.value?.inPfp ?? false);

src/components/MyKiva/BorrowerStatusCard.vue

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ const title = computed(() => `${borrowerName.value} in ${borrowerCountry.value}`
213213
const loanUse = computed(() => loan.value?.use ?? '');
214214
215215
const isFundraising = computed(() => loan.value?.status === FUNDRAISING);
216-
const isPayingBackDelinquent = computed(() => loan.value?.status === PAYING_BACK && loan.value?.delinquent);
217216
218217
const showWhatIsNextColumn = computed(() => {
219218
return !([REFUNDED, EXPIRED, ENDED].includes(loan.value?.status));
@@ -226,8 +225,8 @@ const stepsCopy = computed(() => {
226225
return 'What’s next?';
227226
});
228227
229-
const getPrintableStatus = status => {
230-
switch (status) {
228+
const loanStatus = computed(() => {
229+
switch (loan.value?.status) {
231230
case FUNDRAISING:
232231
return 'Fundraising';
233232
case FUNDED:
@@ -243,13 +242,6 @@ const getPrintableStatus = status => {
243242
default:
244243
return 'Repaid';
245244
}
246-
};
247-
248-
const loanStatus = computed(() => {
249-
if (isPayingBackDelinquent.value) {
250-
return 'Repaying';
251-
}
252-
return getPrintableStatus(loan.value?.status);
253245
});
254246
255247
const description = computed(() => {

0 commit comments

Comments
 (0)