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

[BUG] #4 if user has no post, dont stuck there #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mohokh67
Copy link

will fix the bug #4

@isneezy
Copy link

isneezy commented Mar 4, 2019

Your solution will solve this specific problem, but I think it would be better o do a "catch all" solution. The real problem is the fetchItems action that tries to check if ids is array and then tries to call Object.keys with null or undefined value. we could check if ids has value (is null or undefined) and just assign an empty object or array to ids

fetchItems ({dispatch}, {ids, resource, emoji}) {
    if (!ids) ids = {}
    ids = Array.isArray(ids) ? ids : Object.keys(ids)
    return Promise.all(ids.map(id => dispatch('fetchItem', {id, resource, emoji})))
}

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