Skip to content

Commit

Permalink
Don't discard all promises results when one of them rejects (#25302)
Browse files Browse the repository at this point in the history
* Don't discard promises results when one of them fails

* Simplify the fix by catching after every request
  • Loading branch information
alshakero authored Sep 21, 2020
1 parent 9b49a5f commit 90f17a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/edit-navigation/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const fetchLinkSuggestions = (
type: 'post',
subtype,
} ),
} )
} ).catch( () => [] ) // fail by returning no results
);
}

Expand All @@ -79,7 +79,7 @@ const fetchLinkSuggestions = (
type: 'term',
subtype,
} ),
} )
} ).catch( () => [] )
);
}

Expand All @@ -92,7 +92,7 @@ const fetchLinkSuggestions = (
type: 'post-format',
subtype,
} ),
} )
} ).catch( () => [] )
);
}

Expand Down
6 changes: 3 additions & 3 deletions packages/editor/src/components/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const fetchLinkSuggestions = async (
type: 'post',
subtype,
} ),
} )
} ).catch( () => [] ) // fail by returning no results
);
}

Expand All @@ -81,7 +81,7 @@ const fetchLinkSuggestions = async (
type: 'term',
subtype,
} ),
} )
} ).catch( () => [] )
);
}

Expand All @@ -95,7 +95,7 @@ const fetchLinkSuggestions = async (
type: 'post-format',
subtype,
} ),
} )
} ).catch( () => [] )
);
}

Expand Down

0 comments on commit 90f17a3

Please sign in to comment.