From 2c02a6d36dd204c9e22294ed421ac3d2f7c53e72 Mon Sep 17 00:00:00 2001 From: InKwon James Kim Date: Tue, 10 Dec 2019 19:07:23 +0900 Subject: [PATCH] - edited BlanaceModel for init --- .../DomesticRemit/Application Logic/Model/BalanceModel.swift | 4 ++++ .../View/ViewModel/DomesticRemitViewModel.swift | 3 +++ 2 files changed, 7 insertions(+) diff --git a/GME Remit/Modules/RemittanceModules/DomesticModules/DomesticRemit/Application Logic/Model/BalanceModel.swift b/GME Remit/Modules/RemittanceModules/DomesticModules/DomesticRemit/Application Logic/Model/BalanceModel.swift index 39b0ead7..e517b13e 100644 --- a/GME Remit/Modules/RemittanceModules/DomesticModules/DomesticRemit/Application Logic/Model/BalanceModel.swift +++ b/GME Remit/Modules/RemittanceModules/DomesticModules/DomesticRemit/Application Logic/Model/BalanceModel.swift @@ -29,6 +29,10 @@ struct BalanceModel: Mappable { var accountType: String? var productName: String? + init(balance: String?) { + self.balance = balance + } + init?(map: Map) { } diff --git a/GME Remit/Modules/RemittanceModules/DomesticModules/DomesticRemit/User Interface/View/ViewModel/DomesticRemitViewModel.swift b/GME Remit/Modules/RemittanceModules/DomesticModules/DomesticRemit/User Interface/View/ViewModel/DomesticRemitViewModel.swift index 61b4caf3..2fb7de8c 100644 --- a/GME Remit/Modules/RemittanceModules/DomesticModules/DomesticRemit/User Interface/View/ViewModel/DomesticRemitViewModel.swift +++ b/GME Remit/Modules/RemittanceModules/DomesticModules/DomesticRemit/User Interface/View/ViewModel/DomesticRemitViewModel.swift @@ -228,6 +228,9 @@ extension DomesticRemitViewModel: DomesticRemitViewModelInterface { if model?.type == "wallet" { let serviceFee = (try? getInitialDataLinker.value())?.serviceFeeWallet selectedServiceFeeLinker.onNext(serviceFee) + setBalance(with: BalanceModel( + balance: GMEDB.shared.user.string(.availableBalance)?.currencyToDecimal()) + ) } else { let serviceFee = (try? getInitialDataLinker.value())?.serviceFee selectedServiceFeeLinker.onNext(serviceFee)