Skip to content

Commit

Permalink
frontend decouple reload page on cookies removed (#2199)
Browse files Browse the repository at this point in the history
  • Loading branch information
dinhlongviolin1 authored Nov 4, 2024
1 parent 755abf0 commit b64ed1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions taipy/gui/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
jsonify,
make_response,
render_template,
render_template_string,
request,
send_from_directory,
)
Expand Down Expand Up @@ -169,9 +170,8 @@ def my_index(path):
if resource_handler_id is not None:
resource_handler = _ExternalResourceHandlerManager().get(resource_handler_id)
if resource_handler is None:
response = make_response(
"Cookie was deleted due to invalid resource handler id. Please restart the page manually.", 400
)
reload_html = "<html><head><style>body {background-color: black; margin: 0;}</style></head><body><script>location.reload();</script></body></html>" # noqa: E501
response = make_response(render_template_string(reload_html), 400)
response.set_cookie(
_Server._RESOURCE_HANDLER_ARG, "", secure=request.is_secure, httponly=True, expires=0, path="/"
)
Expand Down

0 comments on commit b64ed1f

Please sign in to comment.