Skip to content

Commit d6788f4

Browse files
fix fallback logic
1 parent d7e1b19 commit d6788f4

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

docs/data/material/components/autocomplete/GoogleMaps.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const fetch = debounce(async (request, callback) => {
9797
}),
9898
);
9999
} catch (err) {
100-
if (err.message === 'Quota exceeded for quota') {
100+
if (err.message.startsWith('Quota exceeded for quota')) {
101101
callback(request.input.length === 1 ? fakeAnswer.p : fakeAnswer.paris);
102102
}
103103

@@ -193,7 +193,6 @@ export default function GoogleMaps() {
193193
includeInputInList
194194
filterSelectedOptions
195195
value={value}
196-
open
197196
noOptionsText="No locations"
198197
onChange={(event, newValue) => {
199198
setOptions(newValue ? [newValue, ...options] : options);

docs/data/material/components/autocomplete/GoogleMaps.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const fetch = debounce(
110110
}),
111111
);
112112
} catch (err: any) {
113-
if (err.message === 'Quota exceeded for quota') {
113+
if (err.message.startsWith('Quota exceeded for quota')) {
114114
callback(request.input.length === 1 ? fakeAnswer.p : fakeAnswer.paris);
115115
}
116116

@@ -211,7 +211,6 @@ export default function GoogleMaps() {
211211
includeInputInList
212212
filterSelectedOptions
213213
value={value}
214-
open
215214
noOptionsText="No locations"
216215
onChange={(event: any, newValue: PlaceType | null) => {
217216
setOptions(newValue ? [newValue, ...options] : options);

0 commit comments

Comments
 (0)