Skip to content

Commit 4fe7592

Browse files
fix: proper fallback option handling
autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters.
1 parent 5025615 commit 4fe7592

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

packages/google-cloud-phishingprotection/src/v1beta1/phishing_protection_service_v1_beta1_client.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,11 @@ export class PhishingProtectionServiceV1Beta1Client {
100100
// const showcaseClient = new showcaseClient({ projectId, customConfig });
101101
opts.clientConfig = opts.clientConfig || {};
102102

103-
const isBrowser = typeof window !== 'undefined';
104-
if (isBrowser) {
105-
opts.fallback = true;
106-
}
107-
// If we are in browser, we are already using fallback because of the
108-
// "browser" field in package.json.
109-
// But if we were explicitly requested to use fallback, let's do it now.
110-
this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax;
103+
// If we're running in browser, it's OK to omit `fallback` since
104+
// google-gax has `browser` field in its `package.json`.
105+
// For Electron (which does not respect `browser` field),
106+
// pass `{fallback: true}` to the PhishingProtectionServiceV1Beta1Client constructor.
107+
this._gaxModule = opts.fallback ? gax.fallback : gax;
111108

112109
// Create a `gaxGrpc` object, with any grpc-specific options
113110
// sent to the client.

packages/google-cloud-phishingprotection/synth.metadata

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/nodejs-phishing-protection.git",
7-
"sha": "f30f164139c18728e33a997d16c900867831389f"
7+
"sha": "8dcefc34ba6b8b7f6e55166c6ba58209a1301375"
88
}
99
},
1010
{

0 commit comments

Comments
 (0)