Skip to content
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

Cryptolist network #588

Merged
merged 2 commits into from
Oct 3, 2023
Merged

Cryptolist network #588

merged 2 commits into from
Oct 3, 2023

Conversation

waelhanfi04
Copy link
Contributor

Pull Request Description:

Summary:

This pull request enhances the filtering logic for a list of items based on specified keys. The primary goal is to display items with specific keys from the keysToDisplay array, and in case a key is not found, replace it with a randomly selected key from the same array.

Changes Made:

  1. Added a getRandomKey() function to generate a random key from the keysToDisplay array.

  2. Modified the existing code to use map instead of filter for iterating through the filterList.

  3. For each item in filterList, we now check if its key is included in keysToDisplay. If it is, the original key is retained. If not, we replace it with a random key generated using getRandomKey().

Why This PR is Necessary:

This PR improves the filtering and display of items by ensuring that the specified keys are included in the result while handling cases where a key is not found gracefully by substituting it with a random key. This enhancement provides a more robust and user-friendly experience when working with the data.

@hichri-louay hichri-louay merged commit a7b472b into develop Oct 3, 2023
@hichri-louay hichri-louay deleted the cryptolist_network branch October 3, 2023 09:14
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.

2 participants