fix: local user setting change #4584
Merged
+39
−28
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.
Description
With the introduction of the newly refactored settings dialog (#4265), it was made possible to add settings screens outside a board.
However, using this in other views, like the WIP template view (#4254) revealed that changing the user name or avatar would not be applied to the state until reloading the page.
The reason for this is simple: We use the features
participants
andauth
separately, both of which contain information about the name and avatar of a user. The difference lies in where the information is available:auth.user
is always available after the user has logged inparticipants.self
is only available after joining a board.The way these two change is also different:
auth.user
is initially retrieved after logging in and doesn't change.participant.self
is updated when a server event is sent.Thus, the solution is to apply the changes to the user (name and avatar specifically) so we aren't dependent on being in a board session. In places where user information is required, using
auth
instead ofparticipants
is required.Changelog
auth
feature instead ofparticipants
in settings.auth
.auth
actioneditUserOptimistically
participants
thunkeditSelf
Checklist