diff --git a/src/app/[locale]/viewer/[base64AasId]/page.tsx b/src/app/[locale]/viewer/[base64AasId]/page.tsx index ab66231..a9bada5 100644 --- a/src/app/[locale]/viewer/[base64AasId]/page.tsx +++ b/src/app/[locale]/viewer/[base64AasId]/page.tsx @@ -48,7 +48,7 @@ export default function Page() { const [aasFromContext, setAasFromContext] = useAasState(); const [submodels, setSubmodels] = useSubmodelState(); const [isSubmodelsLoading, setIsSubmodelsLoading] = useState(true); - const [registryAasData] = useRegistryAasState(); + const [registryAasData, setRegistryAasData] = useRegistryAasState(); useAsyncEffect(async () => { await fetchSubmodels(); @@ -84,6 +84,7 @@ export default function Page() { showError(new LocalizedError(messages.mnestix.aasUrlNotFound), notificationSpawner); } else if (result.aas) { setAasOriginUrl(result.aasData?.aasRepositoryOrigin ?? null); + setRegistryAasData(result.aasData); setAasFromContext(result.aas); } else { navigate.push(result.redirectUrl); diff --git a/src/lib/services/searchUtilActions/SubmodelSearcher.ts b/src/lib/services/searchUtilActions/SubmodelSearcher.ts index 9dfe794..688e354 100644 --- a/src/lib/services/searchUtilActions/SubmodelSearcher.ts +++ b/src/lib/services/searchUtilActions/SubmodelSearcher.ts @@ -34,9 +34,8 @@ export class SubmodelSearcher { const descriptorById = await this.getSubmodelDescriptorById(submodelId); const descriptor = - submodelDescriptor || (process.env.SUBMODEL_REGISTRY_API_URL && descriptorById.isSuccess) - ? descriptorById.result - : null; + submodelDescriptor || + (process.env.SUBMODEL_REGISTRY_API_URL && descriptorById.isSuccess ? descriptorById.result : null); const endpoint = descriptor?.endpoints[0].protocolInformation.href; if (endpoint) {