You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is that on the Stronger app if you log in and go to the Home page. There is a query to firebase that is called at onAppear. It updates the values of the selectedWeek and then the view ExerciseView as well pulls in the recent workout information from Firebase. However these values don't get updated until you navigate using the tabs once or twice. My understanding is that onAppear or even Task should both run when the view loads and then update anything. However this isn't what happens.
.onAppear {
Task {
selectedWeek = try? await calculateWeeksElapsed()
print("selected week in summaryView \(selectedWeek)")
targetProtein = try await getdailyTargetProtein()
print("Daily target protein intake is \(targetProtein)")
}
Task {
targetProtein = try await getdailyTargetProtein()
print("Daily target protein intake is \(targetProtein)")
}
Reproduction
This can be reproduced by logging into the app using the login info [email protected]
password
Then navigate to Home.
Navigate back and forth between Home and Workout and see how the home page updates after a few switches.
Additional context
No response
Code of Conduct
I agree to follow this course's Code of Conduct and Contributing Guidelines
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Related Discussion
The issue is that on the Stronger app if you log in and go to the Home page. There is a query to firebase that is called at onAppear. It updates the values of the selectedWeek and then the view ExerciseView as well pulls in the recent workout information from Firebase. However these values don't get updated until you navigate using the tabs once or twice. My understanding is that onAppear or even Task should both run when the view loads and then update anything. However this isn't what happens.
Reproduction
This can be reproduced by logging into the app using the login info
[email protected]
password
Then navigate to Home.
Navigate back and forth between Home and Workout and see how the home page updates after a few switches.
Additional context
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions