Skip to content

Commit

Permalink
Merge pull request #834 from TokenScript/fix/ensure-toggle-index
Browse files Browse the repository at this point in the history
ensure a toggle index is present with custom tokens
  • Loading branch information
nicktaras authored Sep 20, 2023
2 parents bc49599 + 96871bc commit a4efb49
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/client/views/select-issuers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,10 @@ export class SelectIssuers extends AbstractView {
data-issuer="${issuer}"
${this.client.issuersLoaded === true ? '' : 'disabled'}
>
${
this.client.issuersLoaded === true
? this.params.options.loadAction ?? 'Load'
: '<div class="lds-ellipsis lds-ellipsis-sm" style=""><div></div><div></div><div></div><div></div></div>'
}
${this.client.issuersLoaded === true
? this.params.options.loadAction ?? 'Load'
: '<div class="lds-ellipsis lds-ellipsis-sm" style=""><div></div><div></div><div></div><div></div></div>'
}
</button>
<button aria-label="tokens available from token issuer ${issuer}"
aria-haspopup="true"
Expand Down Expand Up @@ -220,7 +219,7 @@ export class SelectIssuers extends AbstractView {
this.issuerListContainer,
`[data-issuer="${issuer}"] .connect-btn-tn`,
this.params.options.loadAction ?? 'Load',
)
)
return
}

Expand Down Expand Up @@ -251,15 +250,15 @@ export class SelectIssuers extends AbstractView {
this.issuerListContainer,
`[data-issuer="${issuer}"] .connect-btn-tn`,
this.params.options.repeatAction ?? 'Try Again',
)
)
return
}

this.ui.dismissLoader()

if (!tokens?.length) {
this.ui.showError(`
${this.params.options.noTokensFoundEvent ?? 'No tokens found! ' }
${this.params.options.noTokensFoundEvent ?? 'No tokens found! '}
${this.client.getNoTokenMsg(issuer)}`)
applyHTMLElementsInnerText(
this.issuerListContainer,
Expand Down Expand Up @@ -344,19 +343,18 @@ export class SelectIssuers extends AbstractView {

if (config.onChain === false) {
const { title, image } = config

const tokenId = t.tokenId ?? t.ticketId ?? i.toString();
tokens.push(<TokenListItemInterface>{
data: t,
tokenIssuerKey: issuer,
index: t.ticketId,
index: tokenId,
title: title,
image: image,
toggleState: isSelected,
hideToggle: config?.hideToggle,
})
} else {
const tokenId = t.tokenId ?? i.toString()

tokens.push({
data: t,
tokenIssuerKey: issuer,
Expand Down

0 comments on commit a4efb49

Please sign in to comment.