File tree Expand file tree Collapse file tree
Application/DevLogPresentation/Sources Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ struct MainView: View {
4646 homeViewCoordinator. fetchData ( )
4747 } else if newValue == . today {
4848 todayViewCoordinator. fetchData ( )
49+ } else if newValue == . profile {
50+ profileViewCoordinator. fetchData ( )
4951 }
5052 }
5153 . alert (
Original file line number Diff line number Diff line change @@ -118,7 +118,6 @@ struct ProfileView: View {
118118 AccountView ( viewModel: coordinator. makeAccountViewModel ( ) )
119119 }
120120 }
121- . onAppear { coordinator. viewModel. send ( . onAppear) }
122121 . onChange ( of: focused) { _, newValue in
123122 withAnimation {
124123 coordinator. viewModel. send ( . updateStatusTextFieldFocus( newValue) )
Original file line number Diff line number Diff line change @@ -38,6 +38,10 @@ final class ProfileViewCoordinator {
3838 )
3939 }
4040
41+ func fetchData( ) {
42+ viewModel. send ( . fetchData)
43+ }
44+
4145 func makeAccountViewModel( ) -> AccountViewModel {
4246 AccountViewModel (
4347 fetchProvidersUseCase: container. resolve ( FetchAuthProvidersUseCase . self) ,
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ final class ProfileViewModel: Store {
3434 }
3535
3636 enum Action {
37- case onAppear , refresh
37+ case fetchData , refresh
3838 case networkStatusChanged( Bool )
3939 case setLoading( Bool )
4040 case setAlert( Bool )
@@ -98,7 +98,7 @@ final class ProfileViewModel: Store {
9898 var state = self . state
9999 var effects : [ SideEffect ] = [ ]
100100 switch action {
101- case . onAppear , . refresh:
101+ case . fetchData , . refresh:
102102 if state. selectedQuarterStart == nil {
103103 guard let quarterStart = quarterStart ( for: Date ( ) ) else { break }
104104 state. selectedQuarterStart = quarterStart
You can’t perform that action at this time.
0 commit comments