Circuits OK
Accounts Ok Movements OK
This commit is contained in:
@@ -13,6 +13,7 @@ import { serv_constants } from '@store/Modules/serv_constants'
|
||||
import { Api } from '@api'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { static_data } from '@src/db/static_data'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
|
||||
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
@@ -31,10 +32,24 @@ export const useCircuitStore = defineStore('CircuitStore', {
|
||||
|
||||
actions: {
|
||||
getRemainingCoinsToSend(account: IAccount) {
|
||||
return tools.roundDec2(account.saldo + account.fidoConcesso)
|
||||
if (account)
|
||||
return tools.roundDec2(account.saldo + account.fidoConcesso)
|
||||
else
|
||||
return 0
|
||||
},
|
||||
getMaxCoinsToSend(account: IAccount) {
|
||||
return tools.roundDec2(account.qta_maxConcessa - account.saldo)
|
||||
if (account)
|
||||
return tools.roundDec2(account.qta_maxConcessa - account.saldo)
|
||||
else
|
||||
return 0
|
||||
},
|
||||
getSaldoByCircuitId(circuitId: string): number {
|
||||
const userStore = useUserStore()
|
||||
const account = userStore.my.profile.useraccounts.find((rec: IAccount) => rec.circuitId === circuitId)
|
||||
if (account)
|
||||
return account.saldo
|
||||
else
|
||||
return 0
|
||||
},
|
||||
|
||||
async loadCircuits() {
|
||||
|
||||
Reference in New Issue
Block a user