New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enforces uniqueness of profile names #155

Merged
merged 3 commits into from May 22, 2018

Conversation

Projects
None yet
2 participants
@dated
Copy link
Contributor

dated commented May 10, 2018

No description provided.

dated added some commits May 10, 2018

@@ -91,6 +91,16 @@ export class UserDataProvider {
return this.saveProfiles();
}

getProfileByName(name: string) {
for (var profileId in this.profiles) {

This comment has been minimized.

@luciorubeens

luciorubeens May 21, 2018

Member

You can use the find method from lodash:

const profile = = _.find(this.profiles, id => id.name.toLowerCase() === name.toLowerCase());
if (profile) {
  return new Profile().deserialize(profile);
}
@luciorubeens
Copy link
Member

luciorubeens left a comment

Nice! I just added a suggestion to keep the standard

@dated

This comment has been minimized.

Copy link
Contributor Author

dated commented May 21, 2018

thanks for the feedback @luciorubeens! i'll change it accordingly!

@luciorubeens luciorubeens merged commit b27aaa1 into ArkEcosystem:master May 22, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@luciorubeens

This comment has been minimized.

Copy link
Member

luciorubeens commented May 22, 2018

Thank you! 👍

@dated dated deleted the dated:unique-profile-names branch May 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment