Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upenforces uniqueness of profile names #155
Conversation
dated
added some commits
May 10, 2018
luciorubeens
reviewed
May 21, 2018
src/providers/user-data/user-data.ts
Outdated
@@ -91,6 +91,16 @@ export class UserDataProvider { | |||
return this.saveProfiles(); | |||
} | |||
|
|||
getProfileByName(name: string) { | |||
for (var profileId in this.profiles) { |
This comment has been minimized.
This comment has been minimized.
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
reviewed
May 21, 2018
Nice! I just added a suggestion to keep the standard |
This comment has been minimized.
This comment has been minimized.
thanks for the feedback @luciorubeens! i'll change it accordingly! |
luciorubeens
approved these changes
May 22, 2018
luciorubeens
merged commit b27aaa1
into
ArkEcosystem:master
May 22, 2018
1 check passed
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
This comment has been minimized.
This comment has been minimized.
Thank you! |
dated
deleted the
dated:unique-profile-names
branch
May 22, 2018
dated
referenced this pull request
May 31, 2018
Closed
[Post] May developments by the Ark community #1
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.
dated commentedMay 10, 2018
No description provided.