Skip to content

Commit

Permalink
fix metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
josemarinas committed Dec 1, 2023
1 parent 0454acb commit 2fd89e7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions modules/client/src/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1236,12 +1236,14 @@ export async function validateApplyUpdateFunction(
// fetch the metadata
const metadataCid = new MultiUri(metadataUri!).ipfsCid
const metadata = await ipfs.fetchString(metadataCid!);
const metadataJson = JSON.parse(metadata) as PluginRepoBuildMetadata;
const metadataJson = JSON.parse(metadata);
let updateAbi = []
updateAbi = metadataJson?.pluginSetup?.prepareUpdate[plugin.appliedVersion?.build!]?.inputs
if (!updateAbi) {
updateAbi = metadataJson?.pluginSetup?.prepareInstallation?.prepareUpdate[plugin.appliedVersion?.build!]?.inputs
}
// get the update abi for the specified build
if (
metadataJson?.pluginSetup?.prepareUpdate[plugin.appliedVersion?.build!]
?.inputs
) {
if (updateAbi) {
// if the abi exists try to decode the data
const updateAbi = metadataJson.pluginSetup.prepareUpdate[
plugin.appliedVersion?.build!
Expand Down

0 comments on commit 2fd89e7

Please sign in to comment.