From 9ede23d182c87cb769bf5223fa82f5acd62b37ab Mon Sep 17 00:00:00 2001 From: Nick Taras Date: Thu, 28 Sep 2023 13:56:32 +1000 Subject: [PATCH] allow for forced non re-direct mode --- src/client/index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/client/index.ts b/src/client/index.ts index a13182b9..3705eb68 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -747,7 +747,8 @@ export class Client { } private async loadRemoteOutletTokens(issuer: OffChainTokenConfig): Promise { - this.tokenStore.setTokens(issuer.collectionID, []) + const redirectRequired = shouldUseRedirectMode(this.config.offChainRedirectMode) + if (redirectRequired) this.tokenStore.setTokens(issuer.collectionID, []) this.ui.showLoader( `

${this.config.uiOptions?.reDirectIssuerEventHeading ?? 'Connecting to Issuers...'}

`, `${this.config.uiOptions?.reDirectIssuerBodyEvent ?? 'Your browser will re-direct shortly'}`, @@ -770,11 +771,9 @@ export class Client { }, this.config.messagingForceTab, this.config.type === 'active' ? this.ui : null, - window.location.href, + redirectRequired ? window.location.href : false, ) - if (!res) return // Site is redirecting - return res.data?.tokens ?? {} }