Skip to content

Commit

Permalink
Merge pull request #851 from TokenScript/feature/text-config
Browse files Browse the repository at this point in the history
added small ux to stop loading animation when user cancels auto load
  • Loading branch information
nicktaras committed Sep 29, 2023
2 parents ac990fc + 3153a42 commit 9016e78
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ export class Client {
this.tokenStore.clearCachedTokens()
this.eventSender('connected-wallet', null)
this.eventSender('disconnected-wallet', null)
localStorage.removeItem('tn-autoload-tokens')
this.triggerUiUpdateCallback(UIUpdateEventType.WALLET_DISCONNECTED)
} catch (e) {
logger(2, 'Failed to disconnect wallet', e)
Expand Down Expand Up @@ -518,7 +519,7 @@ export class Client {
this.eventSender('tokens-loaded', { loadedCollections: Object.keys(this.tokenStore.getCurrentIssuers()).length })
}

cancelTokenAutoload() {
public cancelTokenAutoload() {
this.cancelAutoload = true
localStorage.setItem('tn-autoload-tokens', 'false')
}
Expand Down Expand Up @@ -1011,6 +1012,11 @@ export class Client {
this.userCancelTokenAutoload = true
this.cancelTokenAutoload()
this.ui.dismissLoader()
// TODO implement communication (pub/sub events)
// to de-couple this logic for default and custom views to utilise.
document.querySelectorAll('.connect-btn-tn .lds-ellipsis').forEach((el) => {
el.parentElement.innerHTML = this.config.uiOptions?.loadAction ?? 'Load Collection'
})
}
})
.catch((err) => {
Expand Down

0 comments on commit 9016e78

Please sign in to comment.