Skip to content

Commit

Permalink
fixed resource-reference spam if ther is no resource-reference on bac…
Browse files Browse the repository at this point in the history
…kend
  • Loading branch information
opaduchak committed Feb 21, 2025
1 parent e3b0909 commit 4372cf1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/packages/addons-service/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class Provider {
@service intl!: Intl;

@tracked node?: NodeModel;
@tracked serviceNode?: ResourceReferenceModel;
@tracked serviceNode?: ResourceReferenceModel | null;

currentUser: CurrentUserService;
@tracked userReference!: UserReferenceModel;
Expand Down Expand Up @@ -115,7 +115,7 @@ export default class Provider {
currentUser: CurrentUserService,
node?: NodeModel,
allConfiguredAddons?: EmberArray<AllConfiguredAddonTypes>,
resourceReference?: ResourceReferenceModel,
resourceReference?: ResourceReferenceModel | null,
userReference?: UserReferenceModel,
) {
setOwner(this, getOwner(provider));
Expand Down Expand Up @@ -179,7 +179,7 @@ export default class Provider {
@task
@waitFor
async getResourceReference() {
if (this.node && !this.serviceNode) {
if (this.node && this.serviceNode === undefined) {
const resourceRefs = await this.store.query('resource-reference', {
filter: {resource_uri: this.node.links.iri?.toString()},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class AddonsServiceManagerComponent extends Component<Args> {
@service toast!: Toast;

node = this.args.node;
@tracked addonServiceNode?: ResourceReferenceModel;
@tracked addonServiceNode?: ResourceReferenceModel | null;
@tracked userReference?: UserReferenceModel;

possibleFilterTypes = Object.values(FilterTypes);
Expand Down Expand Up @@ -343,6 +343,8 @@ export default class AddonsServiceManagerComponent extends Component<Args> {
});
if(references) {
this.addonServiceNode = references.firstObject;
} else {
this.addonServiceNode = null;
}
}

Expand Down

0 comments on commit 4372cf1

Please sign in to comment.