Repository navigation
Keep the units choice in step with the account - #8
Merged
Merged
Conversation
The server now stores the units preference on the user, so the dashboard and the coach can follow it. The app pulls it on launch and on foreground, and pushes when the picker in Settings changes. The server wins once it holds a choice. Until then the app offers its own, except a metric default: the server already reads "unset" as metric, and sending it could overwrite a miles choice still waiting in the athlete's browser from before the preference moved server-side. A server without the endpoint, or no network, leaves the local choice as it was; nothing is shown to the athlete.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #7. Needs the server change in aderaaij/loopback-training-server#12 to do anything; against an older server it changes nothing.
The server now stores the units preference on the user (
GET/PUT /api/me/units), so the dashboard and the coach can follow the same choice as the phone.What changes
Failures are silent: no endpoint or no network leaves the local choice alone.
Checked
On the simulator against a local server built from the server PR:
metricwithin a couple of seconds.Not checked: the first-contact offer from a miles-default device, and the log line for the fallback against a server without the endpoint (the app kept working against the 0.1.15 demo server, which is all I saw).
Deliberately not done
requiredServerVersionis not raised. The sync degrades to today's behaviour on an older server, so a "server is missing features" warning for it seemed like noise. Say so if you'd rather keep the gate strict.