Closed jellegerbrandy closed 5 years ago
There is also the "special case" o fthe "enable predicting" button that covers the staking graph. This I think we do not want to have when the user is not logged in.
thinkin about this some more, what we probably should when clicking on a aciton button when no account is avialble is:
I'm ignoring the portis project for now - but this can be later inserted as a more sophisticated variant of the last step.
@A-Zak we need some copy
Ok, in #350 I have implemented a checkNetworkAndWarn
function, and are calling that just before a transaction is sent. It checks the conditions, and shows an alert if something is wrong, and cancels the transaction. The function is defined here: https://github.com/daostack/alchemy/blob/jelle/src/lib/util.ts#L88
This is used like this
if (!checkNetworkAndWarn()) { return;}
What we still need to do here is:
alert
(of course) but a nicely formatted Modal [:leftarrow: need specs]@jellegerbrandy Question - what types of errors can we get? I'm guessing, no network, wrong network, unknown network... anything else?
So the account/network can be not available for the following reasons:
There is a sepcial case in development/test mode, which works also without metamask. But that is not userland and we can ignore it.
The behavior we want to see when the user is not logged in is that:
(1) action buttons are visible (2) clicking on it will show this warning (now it just logs a warning to the console)
We need some specs @A-Zak and copy