Fix an afterModel check to avoid reloading the page when the queryParam gets updated (#2255)
This commit is contained in:
1 parent
f9cd1c331f
commit
298e804500
1 file changed
+14
-12
@@ -83,18 +83,20 @@ export default class ScopesScopeStorageBucketsNewRoute extends Route {
|
||||
}
|
||||
|
||||
async afterModel() {
|
||||
let scopes;
|
||||
const orgScopes = (
|
||||
await this.store.query('scope', {
|
||||
scope_id: 'global',
|
||||
query: { filters: { scope_id: [{ equals: 'global' }] } },
|
||||
})
|
||||
).map((scope) => ({ model: scope }));
|
||||
scopes = [
|
||||
{ model: this.store.peekRecord('scope', 'global') },
|
||||
...orgScopes,
|
||||
];
|
||||
this.scopes = scopes;
|
||||
if (!this.scopes) {
|
||||
let scopes;
|
||||
const orgScopes = (
|
||||
await this.store.query('scope', {
|
||||
scope_id: 'global',
|
||||
query: { filters: { scope_id: [{ equals: 'global' }] } },
|
||||
})
|
||||
).map((scope) => ({ model: scope }));
|
||||
scopes = [
|
||||
{ model: this.store.peekRecord('scope', 'global') },
|
||||
...orgScopes,
|
||||
];
|
||||
this.scopes = scopes;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user