diff --git a/nicegui/nicegui.py b/nicegui/nicegui.py index 4e7a19d73..f6335dc07 100644 --- a/nicegui/nicegui.py +++ b/nicegui/nicegui.py @@ -11,7 +11,6 @@ wp = jp.QuasarPage(delete_flag=False, title=Ui.config.title, favicon=Ui.config.favicon) wp.tailwind = True # use Tailwind classes instead of Quasars wp.css = HtmlFormatter().get_style_defs('.codehilite') -wp.head_html += '\n' # avoid confirmation dialog for reload main = jp.Div(a=wp, classes='q-ma-md column items-start', style='row-gap: 1em') main.add_page(wp) diff --git a/nicegui/static/templates/js/event_handler.js b/nicegui/static/templates/js/event_handler.js index 638609db5..e6d79aa65 100644 --- a/nicegui/static/templates/js/event_handler.js +++ b/nicegui/static/templates/js/event_handler.js @@ -132,8 +132,7 @@ function send_to_server(e, event_type, debug_flag) { } if (use_websockets) { if (web_socket_closed) { - let ok_to_reload = confirm('Page needs to be reloaded, click OK to reload'); - if (ok_to_reload) window.location.reload(); + window.location.reload(); return; } if (websocket_ready) { @@ -174,4 +173,4 @@ function send_to_server(e, event_type, debug_flag) { } } -// {% endraw %} \ No newline at end of file +// {% endraw %} diff --git a/nicegui/static/templates/main.html b/nicegui/static/templates/main.html index e5ef170c9..8fb85069e 100644 --- a/nicegui/static/templates/main.html +++ b/nicegui/static/templates/main.html @@ -65,16 +65,14 @@ socket.addEventListener('error', function (event) { console.log('Websocket closed'); - let ok_to_reload = confirm('Page needs to be reloaded, click OK to reload'); - if (ok_to_reload) window.location.reload() + window.location.reload() }); var web_socket_closed = false; socket.addEventListener('close', function (event) { console.log('Websocket closed'); web_socket_closed = true; - let ok_to_reload = confirm('Page needs to be reloaded, click OK to reload'); - if (ok_to_reload) window.location.reload() + window.location.reload() }); socket.addEventListener('message', function (event) {