fix: 🐛 targets not displaying even after they are cached (#2429)

* fix: 🐛 targets not displaying even after they are cached

* fix: 🐛 modify check in sessions route
This commit is contained in:
Lisbet Alvarez authored and GitHub committed 2024-08-07 10:38:38 -07:00
1 parent 0d0dadf398
commit a7d9a7e348
2 files changed
+4 -4

No files matched your search

@@ -105,10 +105,10 @@ export default class ScopesScopeProjectsSessionsIndexRoute extends Route {
const totalItems = sessions.meta?.totalItems;
// Query all sessions and all targets for defining filtering values if entering route for the first time
if (!this.allSessions) {
if (!this.allSessions?.length) {
await this.getAllSessions(orgScope, scopes, orgFilter);
}
if (!this.allTargets) {
if (!this.allTargets?.length) {
await this.getAllTargets(orgScope, orgFilter);
}
@@ -100,7 +100,7 @@ export default class ScopesScopeProjectsTargetsIndexRoute extends Route {
scope_id: 'global',
force_refresh: true,
});
const allTargetsPromise = !this.allTargets
const allTargetsPromise = !this.allTargets?.length
? this.makeAllTargetsQuery(orgScope, orgFilter)
: Promise.resolve();
@@ -126,7 +126,7 @@ export default class ScopesScopeProjectsTargetsIndexRoute extends Route {
);
const allTargets = await allTargetsPromise;
if (!this.allTargets) {
if (!this.allTargets?.length) {
// Filter out targets to which users do not have the connect ability
this.allTargets = allTargets.filter((target) =>
target.authorized_actions.includes('authorize-session'),