File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,8 @@ async function fetchResults(remoteInput: RemoteInputElement, checkCurrentQuery:
70
70
71
71
remoteInput . dispatchEvent ( new CustomEvent ( 'loadstart' ) )
72
72
remoteInput . setAttribute ( 'loading' , '' )
73
- let response , html
73
+ let response
74
+ let html = ''
74
75
try {
75
76
response = await fetch ( url , {
76
77
credentials : 'same-origin' ,
@@ -79,9 +80,9 @@ async function fetchResults(remoteInput: RemoteInputElement, checkCurrentQuery:
79
80
html = await response . text ( )
80
81
remoteInput . dispatchEvent ( new CustomEvent ( 'load' ) )
81
82
} catch {
82
- // noop
83
+ // Network errors handled below.
83
84
}
84
- if ( response && response . ok && html ) {
85
+ if ( response && response . ok ) {
85
86
resultsContainer . innerHTML = html
86
87
} else {
87
88
remoteInput . dispatchEvent ( new CustomEvent ( 'error' ) )
You can’t perform that action at this time.
0 commit comments