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

rpc client: Handle case if aepp opened without wallet #388

Merged
merged 2 commits into from
May 13, 2019

Conversation

davidyuk
Copy link
Member

window.parent is equal to window if a web page opened as usual. If we accidentally start dapp in this way (also not setting parent option), then rpc/client will send a hello to itself and fail with exception:

Uncaught TypeError: Cannot destructure property resolve of 'undefined' or 'null'. at receive (client.js?aafa:56)

I think much cleaner for dapp developers to handle this case separately. In that case this PR makes dapp to throw:

Uncaught (in promise) Error: rpc client: Can't send messages to itself at Object._callee$ (client.js?6b57:46)

@davidyuk davidyuk added the enhancement New feature or request label May 11, 2019
@davidyuk davidyuk force-pushed the feature/rpc-better-exception branch from 83d9a99 to 4ed6f5e Compare May 11, 2019 15:20
@nduchak nduchak merged commit 548ae05 into develop May 13, 2019
@nduchak nduchak deleted the feature/rpc-better-exception branch May 16, 2019 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants