-
Notifications
You must be signed in to change notification settings - Fork 572
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
MobileRelayUI #904
MobileRelayUI #904
Conversation
@@ -45,7 +46,7 @@ export interface CoinbaseWalletSDKOptions { | |||
/** @optional whether or not to reload dapp automatically after disconnect, defaults to true */ | |||
reloadOnDisconnect?: boolean; | |||
/** @optional whether to connect mobile web app via WalletLink, defaults to false */ | |||
useMobileWalletLink?: boolean; | |||
enableMobileWalletLink?: boolean; |
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.
avoid confusion as react hook
a0299df
to
807af54
Compare
showConnecting(_options: { | ||
isUnlinkedErrorState?: boolean | undefined; | ||
onCancel: ErrorHandler; | ||
onResetConnection: () => void; | ||
}): () => void { | ||
return () => {}; // no-op | ||
} |
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.
TODO: i might try this thing
adding RedirectDialog
This reverts commit ff0153d.
onButtonClick: () => void; | ||
}; | ||
|
||
export class RedirectDialog { |
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.
|
||
setTimeout(() => { | ||
this.redirectToCoinbaseWallet(walletLinkUrl); | ||
}, 99); |
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.
before redirecting to cb wallet, technically we should wait for message to be transmitted via websocket. but that's hidden very very deep under rxjs swamp.
tried listening to the rx observable, however i have encountered an issue where the browser seems to restrict calling window.open within the rxjs subscription block.
per some SO posts, it's known that browser blocks web apps to call window.open from rxjs handlers.
so, it just uses timeout here and show a dialog with force redirection just in case.
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.
is the goal here to auto redirect if the user doesn't click the button?
location = window.location; | ||
} | ||
|
||
const location = getLocation(); |
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.
moved to util
@@ -863,7 +863,7 @@ export class WalletLinkRelay extends WalletSDKRelayAbstract { | |||
// WIP | |||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | |||
// @ts-ignore | |||
private connectAndSignIn(_params: { | |||
private connectAndSignIn(params: { |
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.
addressing #908 (comment)
packages/wallet-sdk/src/components/RedirectDialog/RedirectDialog.tsx
Outdated
Show resolved
Hide resolved
packages/wallet-sdk/src/components/RedirectDialog/RedirectDialog.tsx
Outdated
Show resolved
Hide resolved
* rename options.useMobileWalletLink to avoid confusion as react hook * rename WalletSDKUI => WalletLinkRelayUI * add MobileRelayUI * implementing MobileRelayUI * rename * fix rename * createWalletLinkUrl * implement MobileRelayUI * open the app after publishWeb3RequestEvent * further simplify * override publishEvent * revert * using timeout * nits * RedirectDialog adding RedirectDialog * for testing. needs to be reverted * ughghghagh * Revert "for testing. needs to be reverted" This reverts commit ff0153d. * this.redirectDialog.present called on openCoinbaseWalletDeeplink * remove logging * address comment * linter … * darkmode * darkmode
* rename options.useMobileWalletLink to avoid confusion as react hook * rename WalletSDKUI => WalletLinkRelayUI * add MobileRelayUI * implementing MobileRelayUI * rename * fix rename * createWalletLinkUrl * implement MobileRelayUI * open the app after publishWeb3RequestEvent * further simplify * override publishEvent * revert * using timeout * nits * RedirectDialog adding RedirectDialog * for testing. needs to be reverted * ughghghagh * Revert "for testing. needs to be reverted" This reverts commit ff0153d. * this.redirectDialog.present called on openCoinbaseWalletDeeplink * remove logging * address comment * linter … * darkmode * darkmode
Summary
How did you test your changes?