Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: polkadot selector lazy loading without session id #94

Merged
merged 13 commits into from
Feb 20, 2024

Conversation

LukassF
Copy link
Contributor

@LukassF LukassF commented Feb 15, 2024

No description provided.

Copy link

vercel bot commented Feb 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
aleph-game ❌ Failed (Inspect) Feb 20, 2024 0:08am

Copy link

🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙

✅ Preview: https://connect-9akasv2sc-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-qwzivmiqo-nightlylabs.vercel.app

}

// fallback when connecting takes too long
if (checks > 1000) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

max load should be 5 sec

// opening modal and waiting for sessionId
if (this._modal) {
this._modal.onClose = () => {
clearInterval(intervalId)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interval might not exist

Comment on lines 480 to 485
intervalId = setInterval((): void => {
checks++
if (this._app && this._modal) {
this._modal.sessionId = this._app.sessionId
clearInterval(intervalId)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how can we clear something that might not yet exist + return

Comment on lines 551 to 569
this._app.on('userConnected', () => {
try {
if (this._chosenMobileWalletName) {
persistRecentStandardWalletForNetwork(this._chosenMobileWalletName, this.network)
} else {
clearRecentStandardWalletForNetwork(this.network)
}
if (!this._app || this._app.accounts.activeAccounts.length <= 0) {
this._connecting = false
// If user does not pass any accounts, we should disconnect
this.disconnect()
}
this._connected = true
this._connecting = false
this._appSessionActive = true
this._modal?.closeModal()
resolve()
} catch {
this.disconnect()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is missing when we are "loading"
this code is in wrong place

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-mmmwas0p1-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙

✅ Preview: https://connect-2eogm71vc-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙

✅ Preview: https://connect-q6flsig33-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-h9n86pqpb-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-ro8u2cze9-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-7wfblxgyf-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙

✅ Preview: https://connect-1t76tsqie-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-12igrujkf-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙

✅ Preview: https://connect-7qgjvtxl2-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙

✅ Preview: https://nightly-connect-storybook-db9smp5du-nightlylabs.vercel.app

Copy link

🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙

✅ Preview: https://connect-jdta21bl5-nightlylabs.vercel.app

// opening modal and waiting for sessionId
if (this._modal) {
this._modal.onClose = () => {
if (intervalId) clearInterval(intervalId)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

@@ -449,6 +449,106 @@ export class NightlyConnectAdapter implements Injected {
return
}

let intervalId: NodeJS.Timeout
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to loadingInterval

@LukassF LukassF merged commit bbff671 into main Feb 20, 2024
4 of 6 checks passed
@LukassF LukassF deleted the lukasz_f_polkadot_selector_lazy branch February 20, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants