From c8ce2ab7132445b3a51d63b9f7764f0566d9c167 Mon Sep 17 00:00:00 2001 From: Bliss Pisit Wetcha Date: Thu, 5 Jan 2023 09:28:32 +0700 Subject: [PATCH] [#24] Fix build --- .../SurveySelection/Account/AccountView.swift | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/iosApp/Survey/Sources/Presentation/Modules/SurveySelection/Account/AccountView.swift b/iosApp/Survey/Sources/Presentation/Modules/SurveySelection/Account/AccountView.swift index 662d9f26..88c1298f 100644 --- a/iosApp/Survey/Sources/Presentation/Modules/SurveySelection/Account/AccountView.swift +++ b/iosApp/Survey/Sources/Presentation/Modules/SurveySelection/Account/AccountView.swift @@ -47,17 +47,9 @@ struct AccountView: View { .loadingDialog(loading: $dataSource.showingLoading) } - init(account: AccountUiModel, coordinator: AccountCoordinator) { - _dataSource = StateObject( - wrappedValue: DataSource( - coordinator: coordinator, - viewModel: AccountViewModel(accountUiModel: account) - ) - ) - } + var account: AccountUiModel? { dataSource.viewState.accountUiModel } var profileSection: some View { - let account = dataSource.viewState.accountUiModel HStack(alignment: .firstTextBaseline) { Text((account?.name).string) .font(.boldLarge) @@ -87,11 +79,19 @@ struct AccountView: View { } var versionSection: some View { - let account = dataSource.viewState.accountUiModel Text((account?.appVersion).string) .font(.regularTiny) .foregroundColor(.white) .opacity(0.5) .accessibility(.account(.versionText)) } + + init(account: AccountUiModel, coordinator: AccountCoordinator) { + _dataSource = StateObject( + wrappedValue: DataSource( + coordinator: coordinator, + viewModel: AccountViewModel(accountUiModel: account) + ) + ) + } }