Displayed error modals when connection to server fails
## Description
Closes #172
Using the already existing modal component, I have covered two edge cases when an error happens, and nothing is displayed to the user.
### First case
If the user goes to their room and clicks on the QR code button quickly, before the `Connection closed` modal pops up, they are presented with the modal that displays the QR code, with a broken image of the QR code, since there's no connection to the server. I simply added an onError listener to the `img` element, that now clearly displays an error modal with information to the user, i.e.:

instead of just:

### Second case
If the connection to the server is failing, we are unable to load the local peers, this failure is not being displayed to the user in any way. A simple modal is now being displayed when the peers are failing to load to the user, asking them to check their internet connection! i.e.:

Whereas before, while peers fail to load, no errors were being displayed at all.
## Testing
- Test by running the `client` without the `server`, go to `localhost:8080/app`, you should have an error modal pop up telling you what the issue is.
- Test by running the `client` without the `server`, go to `localhost:8080/app`, and try to go to the `local network room` really quick before the error modal pops up, and continue to quickly click on the `QR` button, that displays the modal which displays the `QR` code. You should not get an error message when it fails to retrieve the proper `QR` code from the server.
Please let me know if there are any suggestion or requested changes, I'd be glad to apply them!
合并状态:未合并 5 条评论