From fe9aa81fdfaffdc7cde9387aa6f35b0ea212eb5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=BCttner?= <4376726+hanneskuettner@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:17:30 +0200 Subject: [PATCH] Fix live preview target URL with search parameters (#22255) Co-authored-by: Pascal Jufer --- .changeset/long-toes-pull.md | 5 +++++ app/src/modules/content/routes/item.vue | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/long-toes-pull.md diff --git a/.changeset/long-toes-pull.md b/.changeset/long-toes-pull.md new file mode 100644 index 0000000000..ff7df00127 --- /dev/null +++ b/.changeset/long-toes-pull.md @@ -0,0 +1,5 @@ +--- +'@directus/app': patch +--- + +Fixed an endless refresh loop in the live preview of an item accessed through a bookmarked view diff --git a/app/src/modules/content/routes/item.vue b/app/src/modules/content/routes/item.vue index 82772846d1..38067cc868 100644 --- a/app/src/modules/content/routes/item.vue +++ b/app/src/modules/content/routes/item.vue @@ -257,7 +257,8 @@ watch( return; } - const targetUrl = window.location.href + (window.location.href.endsWith('/') ? 'preview' : '/preview'); + const targetUrl = new URL(window.location.href); + targetUrl.pathname += targetUrl.pathname.endsWith('/') ? 'preview' : '/preview'; popupWindow = window.open( targetUrl,