Closed unix closed 3 years ago
Thank you @unix ! I've created a deployment on the goerli testnet bridge: https://imtoken.onrender.com for testing. When logging in from imToken mobile browser, there seems to be issues: when both accounts are connected, the page is blank, do you know how to get the error message ? The above url is working ok on MetaMask mobile.
@paouvrard
According to imToken's documentation, we can access the logs using the debug link (https://imtoken.onrender.com/?___debug=1
), but I didn't find any errors.
After debugging I think the problem may be related to this line of code, the main landing is automatically hidden when params are included in the URL.
const params = Object.keys(window.urlParams.get());
if (transfers.length || params.length) {
window.dom.hide("landing");
}
When any page is opened within the imToken wallet, the source tracking is automatically added, and the URL is added with additional params:
// visit
http://localhost:2222/
// the real URL of the page in imToken wallet
http://localhost:2222/?locale=zh-CN&utm_source=imtoken
To avoid misjudging the params
in the URL, we have at least the following ways to solve it. (It is up to you to decide how to change it.)
if (window.imToken) ...
.window.urlParams.get('transfer')
or others.I see, this is going to be a problem because the @near-eth
library sometimes clears all url params when a NEAR transaction is made which will break imToken, so I will have to adjust it and make a release before this can be merged.
In the mean time imToken users can still interact with the bridge via WalletConnect.
@unix Could you rebase your PR branch so that I can update the preview and test it ?
@paouvrard Resolved.
(You can also change my branch at any time if necessary, the main project maintainer has push/force push
access to the fork repo)
Issue Description
When opening Rainbow Bridge in the browser inside the imToken wallet, the wallet address will not be retrieved, making it impossible to proceed to the next step.
How to Reproduce
https://ethereum.bridgetonear.org/
into your internal browser and visit.Connect
button to observe this issue.Issue Source
The imToken wallet is injected with the exact same provider as the metamask, so we need to use the metamask linking method.
Changes
isImToken
.PS: Rainbow Bridge is an amazing application, imToken Wallet has a lot of users who are using it. This fix will help all users who are using near in imToken, wait for updated news.
Before
After