Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/app/features/project/project.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ export class ProjectComponent implements OnDestroy {
});

effect(() => {
const licenseId = this.currentProject()?.licenseId;

if (licenseId) {
this.actions.getLicense(licenseId);
}
this.actions.getLicense(this.currentProject()?.licenseId);
});

effect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { RegistrationNodeModel } from '@shared/models/registration/registration-
export interface RegistrationOverviewModel extends RegistrationNodeModel {
associatedProjectId?: string;
forksCount: number;
licenseId: string;
licenseId?: string;
providerId: string;
registrationSchemaLink: string;
rootParentId?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class GetRegistryIdentifiers {
export class GetRegistryLicense {
static readonly type = '[Registry] Get Registry License';

constructor(public licenseId: string) {}
constructor(public licenseId: string | undefined) {}
}

export class GetSchemaBlocks {
Expand Down
9 changes: 6 additions & 3 deletions src/app/features/registry/store/registry/registry.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ export class RegistryState {
if (registryOverview.providerId) {
ctx.dispatch(new GetRegistryProvider(registryOverview.providerId));
}
if (registryOverview.licenseId) {
ctx.dispatch(new GetRegistryLicense(registryOverview.licenseId));
}

ctx.dispatch(new GetRegistryLicense(registryOverview.licenseId));
}),
catchError((error) => handleSectionError(ctx, 'registry', error))
);
Expand Down Expand Up @@ -149,6 +148,10 @@ export class RegistryState {

@Action(GetRegistryLicense)
getRegistryLicense(ctx: StateContext<RegistryStateModel>, action: GetRegistryLicense) {
if (!action.licenseId) {
return;
}

const state = ctx.getState();
ctx.patchState({
license: {
Expand Down
Loading