Skip to content

Commit

Permalink
Collection's temp asset arrary is removed before saving
Browse files Browse the repository at this point in the history
  • Loading branch information
macterra committed Oct 21, 2023
1 parent e909bef commit b6fa5ec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions xidb.js
Original file line number Diff line number Diff line change
Expand Up @@ -1499,6 +1499,8 @@ const createCollection = (userId, name) => {
};

const saveCollection = (collection) => {
assert.ok(collection.collection);

const agentData = getAgent(collection.asset.owner);
const collectionId = collection.xid;

Expand All @@ -1507,10 +1509,14 @@ const saveCollection = (collection) => {
saveAgent(agentData);
}

// assets are generated at runtime because metadata.asset.collection is the source of truth
collection.collection.assets = [];
saveAsset(collection);
};

const removeCollection = (collection) => {
assert.ok(collection.collection);

const agentData = getAgent(collection.asset.owner);
const collectionId = collection.xid;

Expand Down

0 comments on commit b6fa5ec

Please sign in to comment.