@eluvio/elv-client-js 4.0.61 → 4.0.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -861,8 +861,8 @@ class ElvWalletClient {
861
861
  async LatestMarketplaceHash({marketplaceParams}) {
862
862
  const marketplaceInfo = await this.MarketplaceInfo({marketplaceParams});
863
863
 
864
- if(this.previewMarketplaceId && this.previewMarketplaceId === marketplaceInfo.marketplaceId) {
865
- return this.availableMarketplaces[marketplaceInfo.tenantSlug][marketplaceInfo.marketplaceSlug]["."].source;
864
+ if(this.previewMarketplaceId && Utils.EqualHash(this.previewMarketplaceId, marketplaceInfo.marketplaceId)) {
865
+ return this.previewMarketplaceHash;
866
866
  }
867
867
 
868
868
  const marketplaceLink = await this.client.ContentObjectMetadata({
@@ -887,18 +887,37 @@ class ElvWalletClient {
887
887
  }
888
888
 
889
889
  if(!this.cachedMarketplaces[marketplaceId]) {
890
- let marketplace = await this.client.ContentObjectMetadata({
891
- libraryId: this.mainSiteLibraryId,
892
- objectId: this.mainSiteId,
893
- metadataSubtree: UrlJoin("/public", "asset_metadata", "tenants", marketplaceInfo.tenantSlug, "marketplaces", marketplaceInfo.marketplaceSlug, "info"),
894
- localizationSubtree: this.localization ? UrlJoin("public", "asset_metadata", "localizations", this.localization, "info") : "",
895
- linkDepthLimit: 1,
896
- resolveLinks: true,
897
- resolveIgnoreErrors: true,
898
- resolveIncludeSource: true,
899
- produceLinkUrls: true,
900
- authorizationToken: this.publicStaticToken
901
- });
890
+ let marketplace;
891
+ if(this.previewMarketplaceId && Utils.EqualHash(marketplaceId, this.previewMarketplaceId)) {
892
+ // Load preview marketplace
893
+ marketplace = await this.client.ContentObjectMetadata({
894
+ versionHash: this.previewMarketplaceHash,
895
+ metadataSubtree: "/public/asset_metadata/info",
896
+ localizationSubtree: this.localization ? UrlJoin("public", "asset_metadata", "localizations", this.localization, "info") : undefined,
897
+ linkDepthLimit: 1,
898
+ resolveLinks: true,
899
+ resolveIgnoreErrors: true,
900
+ resolveIncludeSource: true,
901
+ produceLinkUrls: true,
902
+ authorizationToken: this.publicStaticToken
903
+ });
904
+ } else {
905
+ // Load marketplace from main site tree
906
+ marketplace = await this.client.ContentObjectMetadata({
907
+ libraryId: this.mainSiteLibraryId,
908
+ objectId: this.mainSiteId,
909
+ metadataSubtree: UrlJoin("/public", "asset_metadata", "tenants", marketplaceInfo.tenantSlug, "marketplaces", marketplaceInfo.marketplaceSlug, "info"),
910
+ localizationSubtree: this.localization ?
911
+ UrlJoin("/public", "asset_metadata", "tenants", marketplaceInfo.tenantSlug, "marketplaces", marketplaceInfo.marketplaceSlug, "localizations", this.localization, "info") :
912
+ undefined,
913
+ linkDepthLimit: 1,
914
+ resolveLinks: true,
915
+ resolveIgnoreErrors: true,
916
+ resolveIncludeSource: true,
917
+ produceLinkUrls: true,
918
+ authorizationToken: this.publicStaticToken
919
+ });
920
+ }
902
921
 
903
922
  if(marketplace.branding.use_tenant_styling) {
904
923
  marketplace.tenantBranding = (await this.client.ContentObjectMetadata({