fix rebase error

This commit is contained in:
einhornimmond 2021-10-06 11:59:19 +02:00
parent f6776ca3fc
commit 3112f5b7ea

View File

@ -20,8 +20,17 @@ export class BalanceResolver {
const userEntity = await userRepository.findByPubkeyHex(context.pubKey) const userEntity = await userRepository.findByPubkeyHex(context.pubKey)
const balanceEntity = await balanceRepository.findByUser(userEntity.id) const balanceEntity = await balanceRepository.findByUser(userEntity.id)
let balance: Balance
const now = new Date() const now = new Date()
// No balance found
if (!balanceEntity) {
return new Balance({
balance: 0,
decay: 0,
decay_date: now.toString(),
})
}
return new Balance({ return new Balance({
balance: roundFloorFrom4(balanceEntity.amount), balance: roundFloorFrom4(balanceEntity.amount),
decay: roundFloorFrom4( decay: roundFloorFrom4(
@ -30,4 +39,4 @@ export class BalanceResolver {
decay_date: now.toString(), decay_date: now.toString(),
}) })
} }
} }