Skip to content

Commit

Permalink
applied a default timer value
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Taras authored and Nick Taras committed Oct 6, 2023
1 parent 1ba483b commit b857786
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -768,19 +768,21 @@ export class Client {
private async loadRemoteOutletTokens(issuer: OffChainTokenConfig): Promise<OutletTokenResult | void> {
const redirectRequired = shouldUseRedirectMode(this.config.offChainRedirectMode)
if (redirectRequired) this.tokenStore.setTokens(issuer.collectionID, [])
this.ui?.showLoader(
`<h4>${this.config.uiOptions?.reDirectIssuerEventHeading ?? 'Connecting to Issuers...'}</h4>`,
`<small>${this.config.uiOptions?.reDirectIssuerBodyEvent ?? 'Your browser will re-direct shortly'}</small>`,
`<button class='cancel-autoload-btn btn-tn' aria-label='Cancel page re-direct'>${
this.config.uiOptions?.cancelAction ?? 'Cancel'
}</button>`,
)
if (!issuer.onChain) {
this.enableTokenAutoLoadCancel()
await sleep(this.config.uiOptions.userCancelIssuerAutoRedirectTimer ?? 2500)
if (this.userCancelTokenAutoload) {
this.userCancelTokenAutoload = false
return {}
if (this.ui) {
this.ui.showLoader(
`<h4>${this.config.uiOptions?.reDirectIssuerEventHeading ?? 'Connecting to Issuers...'}</h4>`,
`<small>${this.config.uiOptions?.reDirectIssuerBodyEvent ?? 'Your browser will re-direct shortly'}</small>`,
`<button class='cancel-autoload-btn btn-tn' aria-label='Cancel page re-direct'>${
this.config.uiOptions?.cancelAction ?? 'Cancel'
}</button>`,
)
if (!issuer.onChain) {
this.enableTokenAutoLoadCancel()
await sleep(this.config.uiOptions.userCancelIssuerAutoRedirectTimer ?? 2500)
if (this.userCancelTokenAutoload) {
this.userCancelTokenAutoload = false
return {}
}
}
}
const res = await this.messaging.sendMessage(
Expand Down

0 comments on commit b857786

Please sign in to comment.