Skip to content

Commit fa69912

Browse files
committed
PR feedback
1 parent 53460df commit fa69912

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/query-helpers.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ const wrapSingleQueryWithSuggestion = (query, queryAllByName, variant) => (
9393
...args
9494
) => {
9595
const element = query(container, ...args)
96-
const [{suggest = true} = {}] = args.slice(-1)
97-
if (getConfig().throwSuggestions && suggest) {
96+
const [{suggest = getConfig().throwSuggestions} = {}] = args.slice(-1)
97+
if (suggest) {
9898
const suggestion = getSuggestedQuery(element, variant)
9999
if (suggestion && !queryAllByName.endsWith(suggestion.queryName)) {
100100
throw getSuggestionError(suggestion.toString(), container)
@@ -110,8 +110,8 @@ const wrapAllByQueryWithSuggestion = (query, queryAllByName, variant) => (
110110
) => {
111111
const els = query(container, ...args)
112112

113-
const [{suggest = true} = {}] = args.slice(-1)
114-
if (suggest && getConfig().throwSuggestions) {
113+
const [{suggest = getConfig().throwSuggestions} = {}] = args.slice(-1)
114+
if (suggest) {
115115
// get a unique list of all suggestion messages. We are only going to make a suggestion if
116116
// all the suggestions are the same
117117
const uniqueSuggestionMessages = [

0 commit comments

Comments
 (0)