From dbbb94117c2d6266cfc45a091b4b87012024f788 Mon Sep 17 00:00:00 2001 From: Raphael Kabo Date: Mon, 9 Oct 2023 17:24:09 +0100 Subject: Fix event token param bug --- views/event.handlebars | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'views/event.handlebars') diff --git a/views/event.handlebars b/views/event.handlebars index ae6674a..f4f1a2e 100755 --- a/views/event.handlebars +++ b/views/event.handlebars @@ -423,9 +423,9 @@ window.eventData = {{{ json jsonData }}}; $(this).closest(".comment").find(".replyContainer").slideToggle(); }) $(document).ready(function() { - // Save the editing token from the URL, if it is valid const eventID = $('#eventName').attr('data-event-id'); + const url = new URL(window.location.href); const urlParams = new URLSearchParams(window.location.search); if (urlParams.has('e')) { $.ajax({ @@ -463,6 +463,8 @@ window.eventData = {{{ json jsonData }}}; if (urlParams.has('show_edit')) { $('#editModal').modal('show'); + url.searchParams.delete('show_edit'); + history.replaceState(history.state, '', url.href); } // From https://davidwalsh.name/javascript-download -- cgit v1.2.3