Fixed transaction card money style for credited accounts.
Build and Deploy Web App / build-and-deploy (push) Successful in 24s Details

This commit is contained in:
andrewlalis 2025-09-06 19:13:44 -04:00
parent 5bda6812d6
commit c9d20f2475
1 changed files with 2 additions and 9 deletions

View File

@ -5,7 +5,6 @@ import type { TransactionsListItem } from '@/api/transaction';
import { useRoute, useRouter } from 'vue-router';
import CategoryLabel from './CategoryLabel.vue';
import { computed, type Ref } from 'vue';
import { AccountTypes } from '@/api/account';
const router = useRouter()
const route = useRoute()
@ -16,15 +15,9 @@ const props = defineProps<{ tx: TransactionsListItem }>()
// Defines the style to use for money based on which accounts are involved.
const moneyStyle: Ref<MoneyStyle> = computed(() => {
if (props.tx.debitedAccount !== null && props.tx.creditedAccount === null) {
const debitedAccountType = AccountTypes.of(props.tx.debitedAccount.type)
return debitedAccountType.debitsPositive
? "positive"
: "negative"
return "positive"
} else if (props.tx.creditedAccount !== null && props.tx.debitedAccount === null) {
const creditedAccountType = AccountTypes.of(props.tx.creditedAccount.type)
return creditedAccountType.debitsPositive
? "negative"
: "positive"
return "negative"
}
return "neutral"
})