mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 18:56:55 +02:00
additionally handle item urls (marketplace links from cert inspections)
This commit is contained in:
parent
a6ef25f662
commit
b45677cd02
1 changed files with 6 additions and 3 deletions
|
@ -118,13 +118,16 @@ function openMarketplace(optionalItemOrUrl) {
|
||||||
// AND... if call onMarketplaceOpen to setupWallet if we need to.
|
// AND... if call onMarketplaceOpen to setupWallet if we need to.
|
||||||
var url = optionalItemOrUrl || MARKETPLACE_URL_INITIAL;
|
var url = optionalItemOrUrl || MARKETPLACE_URL_INITIAL;
|
||||||
var cta = 'marketplace cta';
|
var cta = 'marketplace cta';
|
||||||
|
var match;
|
||||||
|
// If optionalItemOrUrl contains the metaverse base, then it's a url, not an item id.
|
||||||
if (optionalItemOrUrl && optionalItemOrUrl.indexOf(METAVERSE_SERVER_URL) === -1) {
|
if (optionalItemOrUrl && optionalItemOrUrl.indexOf(METAVERSE_SERVER_URL) === -1) {
|
||||||
cta = optionalItemOrUrl; // item id
|
cta = optionalItemOrUrl; // item id
|
||||||
url = MARKETPLACE_URL + '/items/' + optionalItemOrUrl;
|
url = MARKETPLACE_URL + '/items/' + optionalItemOrUrl;
|
||||||
} else if (optionalItemOrUrl) {
|
} else if (optionalItemOrUrl) {
|
||||||
// A specific url. Don't attempt to set up wallet because we don't have a way to come back.
|
// A specific url.
|
||||||
// Does that ever happen without the wallet already setup?
|
match = optionalItemOrUrl.match(/\/item\/(\w+)$/);
|
||||||
cta = '';
|
// Don't attempt to set up wallet for a non-item url because we don't have a way to come back.
|
||||||
|
cta = (match && match[1]) || '';
|
||||||
}
|
}
|
||||||
ui.open(url, MARKETPLACES_INJECT_SCRIPT_URL);
|
ui.open(url, MARKETPLACES_INJECT_SCRIPT_URL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue