mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 12:13:28 +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.
|
||||
var url = optionalItemOrUrl || MARKETPLACE_URL_INITIAL;
|
||||
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) {
|
||||
cta = optionalItemOrUrl; // item id
|
||||
url = MARKETPLACE_URL + '/items/' + optionalItemOrUrl;
|
||||
} else if (optionalItemOrUrl) {
|
||||
// A specific url. Don't attempt to set up wallet because we don't have a way to come back.
|
||||
// Does that ever happen without the wallet already setup?
|
||||
cta = '';
|
||||
// A specific url.
|
||||
match = optionalItemOrUrl.match(/\/item\/(\w+)$/);
|
||||
// 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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue