diff --git a/ui/desktop/app/routes/scopes/scope/projects.js b/ui/desktop/app/routes/scopes/scope/projects.js index 2d37e18a3..d8f6e0bbb 100644 --- a/ui/desktop/app/routes/scopes/scope/projects.js +++ b/ui/desktop/app/routes/scopes/scope/projects.js @@ -36,6 +36,7 @@ export default class ScopesScopeProjectsRoute extends Route { @service clientAgentSessions; @service pollster; @service flashMessages; + @service features; // =methods @@ -48,18 +49,22 @@ export default class ScopesScopeProjectsRoute extends Route { /** * Primes the store with _all project scopes_ under global. - * @return {Promise{ScopeModel}} + * @return {Promise} */ async model() { - // Setup the poller job - if (!this.job) { - this.boundPoller = this.poller.bind(this); - this.job = this.pollster.findOrCreateJob(this.boundPoller, 2000); - } + if (this.features.isEnabled('client-agent')) { + // Setup the poller job + if (!this.job) { + this.boundPoller = this.poller.bind(this); + this.job = this.pollster.findOrCreateJob(this.boundPoller, 2000); + } - const isClientAgentRunning = await this.ipc.invoke('isClientAgentRunning'); - if (isClientAgentRunning) { - this.job.start(); + const isClientAgentRunning = await this.ipc.invoke( + 'isClientAgentRunning', + ); + if (isClientAgentRunning) { + this.job.start(); + } } const { id: scope_id } = this.modelFor('scopes.scope'); diff --git a/ui/desktop/app/routes/scopes/scope/projects/sessions/session.js b/ui/desktop/app/routes/scopes/scope/projects/sessions/session.js index 2fe6171ef..53ea5d197 100644 --- a/ui/desktop/app/routes/scopes/scope/projects/sessions/session.js +++ b/ui/desktop/app/routes/scopes/scope/projects/sessions/session.js @@ -14,6 +14,7 @@ export default class ScopesScopeProjectsSessionsSessionRoute extends Route { @service clientAgentSessions; @service flashMessages; @service intl; + @service features; // =methods @@ -29,6 +30,7 @@ export default class ScopesScopeProjectsSessionsSessionRoute extends Route { // If we don't have any credentials, we'll try to fetch them from the client agent in case this session // was initiated through the client agent. if ( + this.features.isEnabled('client-agent') && !session.credentials.length && (await this.ipc.invoke('isClientAgentRunning')) ) { diff --git a/ui/desktop/config/environment.js b/ui/desktop/config/environment.js index bb1024e22..d3ae0cfaf 100644 --- a/ui/desktop/config/environment.js +++ b/ui/desktop/config/environment.js @@ -61,9 +61,7 @@ module.exports = function (environment) { }, featureFlags: { - search: false, - filter: true, - 'post-connection-workflow': false, + 'client-agent': false, }, }; @@ -84,7 +82,7 @@ module.exports = function (environment) { : true; // Enable features in development - ENV.featureFlags['post-connection-workflow'] = true; + ENV.featureFlags['client-agent'] = true; } if (environment === 'test') {