-
Notifications
You must be signed in to change notification settings - Fork 16
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙
|
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
} | ||
|
||
// fallback when connecting takes too long | ||
if (checks > 1000) { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interval might not exist
intervalId = setInterval((): void => { | ||
checks++ | ||
if (this._app && this._modal) { | ||
this._modal.sessionId = this._app.sessionId | ||
clearInterval(intervalId) | ||
} |
There was a problem hiding this comment.
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
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() |
There was a problem hiding this comment.
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
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙
|
🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙
|
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙
|
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙
|
🤙🤙🤙🤙 STORYBOOK 🤙🤙🤙🤙
|
🤙🤙🤙🤙 EXAMPLE PREVIEW 🤙🤙🤙🤙
|
// opening modal and waiting for sessionId | ||
if (this._modal) { | ||
this._modal.onClose = () => { | ||
if (intervalId) clearInterval(intervalId) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to loadingInterval
No description provided.