vue-master-class icon indicating copy to clipboard operation
vue-master-class copied to clipboard

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

Open mohokh67 opened this issue 7 years ago • 1 comments

will fix the bug #4

mohokh67 avatar Nov 14 '18 14:11 mohokh67

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})))
}

isneezy avatar Mar 04 '19 08:03 isneezy