Skip to content
This repository was archived by the owner on Jul 13, 2023. It is now read-only.

Commit 180d2e2

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 1d96183 commit 180d2e2

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

src/v1beta1/data_labeling_service_client.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,11 @@ export class DataLabelingServiceClient {
109109
// const showcaseClient = new showcaseClient({ projectId, customConfig });
110110
opts.clientConfig = opts.clientConfig || {};
111111

112-
const isBrowser = typeof window !== 'undefined';
113-
if (isBrowser) {
114-
opts.fallback = true;
115-
}
116-
// If we are in browser, we are already using fallback because of the
117-
// "browser" field in package.json.
118-
// But if we were explicitly requested to use fallback, let's do it now.
119-
this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax;
112+
// If we're running in browser, it's OK to omit `fallback` since
113+
// google-gax has `browser` field in its `package.json`.
114+
// For Electron (which does not respect `browser` field),
115+
// pass `{fallback: true}` to the DataLabelingServiceClient constructor.
116+
this._gaxModule = opts.fallback ? gax.fallback : gax;
120117

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

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-datalabeling.git",
7-
"sha": "c221d20ca6db52d9c42940bd37efba8e04130fe2"
7+
"sha": "1d96183093753483a60989c0e688e23bfca3879f"
88
}
99
},
1010
{

0 commit comments

Comments
 (0)