From 3543ef28245c3c7e6339fe045e3d5a0ede9896fd Mon Sep 17 00:00:00 2001 From: Hardcore Sushi Date: Fri, 4 Jun 2021 13:14:29 +0200 Subject: [PATCH] Handle websocket disconnection on UI --- src/frontend/index.css | 16 ++++++++++-- src/frontend/index.html | 4 +++ src/frontend/index.js | 57 +++++++++++++++++++++++------------------ 3 files changed, 50 insertions(+), 27 deletions(-) diff --git a/src/frontend/index.css b/src/frontend/index.css index 4631f39..013aa92 100644 --- a/src/frontend/index.css +++ b/src/frontend/index.css @@ -356,7 +356,6 @@ button:hover::after { } #file_transfer { border-top: 2px solid var(--accent); - display: none; position: relative; } #file_transfer.active { @@ -454,6 +453,19 @@ button:hover::after { width: 2em; margin-left: 15px; } -#message_box, #chat_header, #msg_log { +#message_box, #chat_header, #msg_log, #file_transfer { display: none; } +#disconnected { + display: none; + height: 100%; + align-items: center; + justify-content: center; +} +#disconnected.disconnected { + display: flex; +} +#disconnected img { + width: 70px; + height: 70px; +} \ No newline at end of file diff --git a/src/frontend/index.html b/src/frontend/index.html index ca6b87e..1beaa55 100644 --- a/src/frontend/index.html +++ b/src/frontend/index.html @@ -61,6 +61,10 @@ +
+ +

Websocket connection closed

+