File tree 4 files changed +17
-26
lines changed
packages/google-cloud-tasks
4 files changed +17
-26
lines changed Original file line number Diff line number Diff line change @@ -109,14 +109,11 @@ export class CloudTasksClient {
109
109
// const showcaseClient = new showcaseClient({ projectId, customConfig });
110
110
opts . clientConfig = opts . clientConfig || { } ;
111
111
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 CloudTasksClient constructor.
116
+ this . _gaxModule = opts . fallback ? gax . fallback : gax ;
120
117
121
118
// Create a `gaxGrpc` object, with any grpc-specific options
122
119
// sent to the client.
Original file line number Diff line number Diff line change @@ -109,14 +109,11 @@ export class CloudTasksClient {
109
109
// const showcaseClient = new showcaseClient({ projectId, customConfig });
110
110
opts . clientConfig = opts . clientConfig || { } ;
111
111
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 CloudTasksClient constructor.
116
+ this . _gaxModule = opts . fallback ? gax . fallback : gax ;
120
117
121
118
// Create a `gaxGrpc` object, with any grpc-specific options
122
119
// sent to the client.
Original file line number Diff line number Diff line change @@ -109,14 +109,11 @@ export class CloudTasksClient {
109
109
// const showcaseClient = new showcaseClient({ projectId, customConfig });
110
110
opts . clientConfig = opts . clientConfig || { } ;
111
111
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 CloudTasksClient constructor.
116
+ this . _gaxModule = opts . fallback ? gax . fallback : gax ;
120
117
121
118
// Create a `gaxGrpc` object, with any grpc-specific options
122
119
// sent to the client.
Original file line number Diff line number Diff line change 4
4
"git": {
5
5
"name": ".",
6
6
"remote": "https://github.com/googleapis/nodejs-tasks.git",
7
- "sha": "ad876bca51afe0e69e41f436208f93f81a5dff67 "
7
+ "sha": "b2b7fd3103afb35972e2c58f302a93e15abaa761 "
8
8
}
9
9
},
10
10
{
19
19
"git": {
20
20
"name": "synthtool",
21
21
"remote": "https://github.com/googleapis/synthtool.git",
22
- "sha": "1c92077459db3dc50741e878f98b08c6261181e0 "
22
+ "sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469 "
23
23
}
24
24
}
25
25
],
You can’t perform that action at this time.
0 commit comments