Skip to content

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