Fix live preview target URL with search parameters (#22255)

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
This commit is contained in:
Hannes Küttner
2024-04-19 12:17:30 +02:00
committed by GitHub
parent d37a16a31e
commit fe9aa81fdf
2 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
'@directus/app': patch
---
Fixed an endless refresh loop in the live preview of an item accessed through a bookmarked view

View File

@@ -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,