Skip to content

[FIX] users.getPreferences when the user doesn't have any preferences#13532

Merged
rodrigok merged 1 commit intoRocketChat:developfrom
thayannevls:fix-getPreferences-when-user-doesnt-have-preferences
Apr 6, 2019
Merged

[FIX] users.getPreferences when the user doesn't have any preferences#13532
rodrigok merged 1 commit intoRocketChat:developfrom
thayannevls:fix-getPreferences-when-user-doesnt-have-preferences

Conversation

@thayannevls
Copy link
Copy Markdown
Contributor

Closes #12976

When normal users doesn't have any preferences, user.settings is an empty object instead of undefined. My solution was to check both.

Maybe a better solution is all users start with settings as undefined.

@ggazzo ggazzo requested a review from sampaiodiego March 1, 2019 06:38
@sampaiodiego sampaiodiego added this to the 1.0.0 milestone Mar 1, 2019
@thayannevls
Copy link
Copy Markdown
Contributor Author

@rodrigok should I keep checking if is an empty object?

@MarcosSpessatto
Copy link
Copy Markdown
Contributor

@thayannevls no, you can remove it.

@MarcosSpessatto
Copy link
Copy Markdown
Contributor

@thayannevls can you please fix the conflicts?

@thayannevls thayannevls force-pushed the fix-getPreferences-when-user-doesnt-have-preferences branch from e512d7c to 0cabdb7 Compare March 15, 2019 14:28
@thayannevls
Copy link
Copy Markdown
Contributor Author

@MarcosSpessatto Fixed it! Sorry for the delay.

@engelgabriel engelgabriel requested a review from rodrigok April 6, 2019 04:06
@rodrigok rodrigok merged commit 1e82c37 into RocketChat:develop Apr 6, 2019
@rodrigok rodrigok mentioned this pull request Apr 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants