From c2b4c0ad8b10ac3cd28c7d70ecfe42804317c806 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Fri, 4 Jun 2021 11:31:29 -0700 Subject: [PATCH] Change model attributes to tracked --- addons/api/addon/models/session.js | 5 +++-- ui/desktop/app/routes/scopes/scope/projects/targets.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/api/addon/models/session.js b/addons/api/addon/models/session.js index b6ceadd4d..f85593958 100644 --- a/addons/api/addon/models/session.js +++ b/addons/api/addon/models/session.js @@ -2,12 +2,13 @@ import GeneratedSessionModel from '../generated/models/session'; import { computed } from '@ember/object'; import { equal } from '@ember/object/computed'; import { attr } from '@ember-data/model'; +import { tracked } from '@glimmer/tracking'; export default class SessionModel extends GeneratedSessionModel { // =attributes - @attr('boolean', { readOnly: true }) acknowledged; - @attr('boolean', { readOnly: true }) started_desktop_client; + @tracked acknowledged; + @tracked started_desktop_client; @attr('string', { readOnly: true }) proxy_address; @attr('number', { readOnly: true }) proxy_port; diff --git a/ui/desktop/app/routes/scopes/scope/projects/targets.js b/ui/desktop/app/routes/scopes/scope/projects/targets.js index a12d0a7cf..3b847e020 100644 --- a/ui/desktop/app/routes/scopes/scope/projects/targets.js +++ b/ui/desktop/app/routes/scopes/scope/projects/targets.js @@ -111,7 +111,9 @@ export default class ScopesScopeProjectsTargetsRoute extends Route { // Associate the connection details with the session const { session_id, address, port } = connectionDetails; - await this.store.findRecord('session', session_id); + const session = await this.store.findRecord('session', session_id); + // Flag the session has been open in the desktop client + session.started_desktop_client = true; // Update the session record with proxy information from the CLI // This is read-only information that shouldn't dirty the session, @@ -124,7 +126,6 @@ export default class ScopesScopeProjectsTargetsRoute extends Route { id: session_id, type: 'session', attributes: { - started_desktop_client: true, proxy_address: address, proxy_port: port }