Switch the network if removing the active network #566
Switch the network if removing the active network #566
Conversation
added one more commit which fixes: #568 |
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.
Typo change mostly. Possible UX change.
Everything else works well and didn't have any actual problems 👌
if (isActive) { | ||
dialogService.openLoadingDialog(self.currentTheme, | ||
gettext('Network removed succesfully'), | ||
gettext('Network removed succesfully - will now switch the network')) |
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.
"successfully" is spelt incorrectly. Also, i'm not sure how much work it would be, but maybe changing it so it's not a loading dialog but a dialog that tells them the wallet needs to reload, with a reload button. then it just reloads on close 🤷♂️
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.
Well "the problem" is, that this is a generic loading dialog which I did either reuse here or reuse in another place (cannot remember) :P For me in this situation it's enough (because almost nobody ever deletes a network) - but of course in the end it's your decision :)
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.
@luciorubeens and/or @j-a-m-l, what do you guys think?
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.
A simple solution would be adding a new parameter to openLoadingDialog
that permits customizing its behaviour or content.
2 examples:
- Using
templateUrl
, to add there the reload button. - Passing a
options
parameter that enables HTML instead of pure text (and change the template too).
Those ideas could be used to display the success removal message and the reload button, as a confirmation, instead of using the toast and the 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.
I guess I just fail to see the advantage of showing a button to the user. He cannot do anything anyway - he HAS to reload because the network was deleted and the dialog is modal.
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.
To me the UX didn't feel seamless. I'd rather a button I have to press to reload, because then I can press it in my own time. Loading screens I feel are used for processing in the background or waiting for something to happen, and not to display a message to the user, because I might be a slow reader who didn't manage to read the whole message before it disappeared.
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.
Okay, that's a valid point.
I will adjust it accordingly.
However I will open a custom dialog then, because the loading indicator is in this case not relevant anymore, you don't have to wait for anything anyway :)
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.
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.
Looks good! I'll have a cheeky test Monday
toastService.success(gettext('Network removed succesfully!'), 3000) | ||
if (isActive) { | ||
dialogService.openLoadingDialog(self.currentTheme, | ||
gettext('Network removed succesfully'), |
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.
"successfully" is spelt incorrectly
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.
done
setTimeout(() => networkService.switchNetwork(null, true), 4000) | ||
} else { | ||
self.listNetworks = networkService.getNetworks() | ||
toastService.success(gettext('Network removed succesfully!'), 3000) |
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.
"successfully" is spelt incorrectly
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.
done
dialogService.openLoadingDialog(self.currentTheme, | ||
gettext('Network removed succesfully'), | ||
gettext('Network removed succesfully - will now switch the network')) | ||
setTimeout(() => networkService.switchNetwork(null, true), 4000) |
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.
Maybe halve the timeout as felt a bit long for me, it was enough time for me to wonder if it was going to reload.
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.
I set the timeout this high because I thought else the user doesn't have enough time to read the message, but I will halve it in this case.
Edit: Tested it and with 2000 I find it hard to read, set it to 3000 - so we meet in the middle :D
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.
oh maybe take a look at my other comment. instead of doing a timeout, #566 (comment)
Looks good and working as expected. 👍 |
Also fixes a bug related to the background.
Fixes: #565