diff --git a/packages/google-cloud-talent/src/v4beta1/application_service_client.ts b/packages/google-cloud-talent/src/v4beta1/application_service_client.ts index c7159f193d5..55c2540b43a 100644 --- a/packages/google-cloud-talent/src/v4beta1/application_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/application_service_client.ts @@ -109,14 +109,11 @@ export class ApplicationServiceClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the ApplicationServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-talent/src/v4beta1/company_service_client.ts b/packages/google-cloud-talent/src/v4beta1/company_service_client.ts index f56f8ec9e1a..ce495b1acdb 100644 --- a/packages/google-cloud-talent/src/v4beta1/company_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/company_service_client.ts @@ -108,14 +108,11 @@ export class CompanyServiceClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the CompanyServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-talent/src/v4beta1/completion_client.ts b/packages/google-cloud-talent/src/v4beta1/completion_client.ts index 003a5869e67..f986e01bd8f 100644 --- a/packages/google-cloud-talent/src/v4beta1/completion_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/completion_client.ts @@ -99,14 +99,11 @@ export class CompletionClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the CompletionClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-talent/src/v4beta1/event_service_client.ts b/packages/google-cloud-talent/src/v4beta1/event_service_client.ts index c410556c3f0..2d0ec42b70a 100644 --- a/packages/google-cloud-talent/src/v4beta1/event_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/event_service_client.ts @@ -99,14 +99,11 @@ export class EventServiceClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the EventServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-talent/src/v4beta1/job_service_client.ts b/packages/google-cloud-talent/src/v4beta1/job_service_client.ts index 15d2c91ac7e..33cb90ebd9c 100644 --- a/packages/google-cloud-talent/src/v4beta1/job_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/job_service_client.ts @@ -110,14 +110,11 @@ export class JobServiceClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the JobServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-talent/src/v4beta1/profile_service_client.ts b/packages/google-cloud-talent/src/v4beta1/profile_service_client.ts index c0293d7cf1b..b1e0fb2968d 100644 --- a/packages/google-cloud-talent/src/v4beta1/profile_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/profile_service_client.ts @@ -109,14 +109,11 @@ export class ProfileServiceClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the ProfileServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-talent/src/v4beta1/tenant_service_client.ts b/packages/google-cloud-talent/src/v4beta1/tenant_service_client.ts index f2f863dcaa1..8a47b9bf84c 100644 --- a/packages/google-cloud-talent/src/v4beta1/tenant_service_client.ts +++ b/packages/google-cloud-talent/src/v4beta1/tenant_service_client.ts @@ -108,14 +108,11 @@ export class TenantServiceClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the TenantServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-talent/synth.metadata b/packages/google-cloud-talent/synth.metadata index f74812973b4..7c113d091b2 100644 --- a/packages/google-cloud-talent/synth.metadata +++ b/packages/google-cloud-talent/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-talent.git", - "sha": "9a960eb5d57f46fc2e29fa2da78f086c226485fa" + "sha": "8cba7c33ca1d631e7d369ec06ebf2bdf39530ffd" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1c92077459db3dc50741e878f98b08c6261181e0" + "sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469" } } ],