Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show only on-chain collection items #254

Merged
merged 2 commits into from
Apr 23, 2024
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
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@logion/client",
"version": "0.43.0",
"version": "0.43.1-1",
"description": "logion SDK for client applications",
"main": "dist/index.js",
"packageManager": "[email protected]",
Expand Down
7 changes: 1 addition & 6 deletions packages/client/src/LocClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,11 +612,6 @@ export abstract class LocClient {
const { locId } = parameters;
const onchainItems = await this.nodeApi.queries.getCollectionItems(locId);

const onchainItemsMap: Record<string, CollectionItem> = {};
for(const item of onchainItems) {
onchainItemsMap[item.id.toHex()] = item;
}

try {
const offchainItems = await this.getOffchainItems({ locId });

Expand All @@ -625,7 +620,7 @@ export abstract class LocClient {
offchainItemsMap[item.itemId] = item;
}

return offchainItems.map(item => this.mergeItems(onchainItemsMap[item.itemId], offchainItemsMap[item.itemId]));
return onchainItems.map(item => this.mergeItems(item, offchainItemsMap[item.id.toHex()]));
} catch(e) {
throw newBackendError(e);
}
Expand Down
3 changes: 2 additions & 1 deletion packages/client/src/license/Factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export class MergedTermsAndConditionsElement {

/**
* Creates a new Terms and Conditions, based on given type.
* @param termsAndConditions the Terms and Conditions elements, as stored on the chain.
* @param onchainTCs the Terms and Conditions elements, as stored on the chain.
* @param offchainTCs the Terms and Conditions elements, as stored on the off-chain backend.
* @return an array of terms and conditions element
* @group TermsAndConditions
*/
Expand Down
Loading