victor HF Staff commited on
Commit
604b9db
·
1 Parent(s): d321ce2

Fix URL reactivity in UploadedFile component

Browse files

Capture the URL without trailing slash once at component creation to prevent unnecessary reactive updates during navigation.

src/lib/components/chat/UploadedFile.svelte CHANGED
@@ -20,7 +20,8 @@
20
 
21
  let showModal = $state(false);
22
 
23
- let urlNotTrailing = $derived(page.url.pathname.replace(/\/$/, ""));
 
24
 
25
  function truncateMiddle(text: string, maxLength: number): string {
26
  if (text.length <= maxLength) {
 
20
 
21
  let showModal = $state(false);
22
 
23
+ // Capture URL once at component creation to prevent reactive updates during navigation
24
+ let urlNotTrailing = page.url.pathname.replace(/\/$/, "");
25
 
26
  function truncateMiddle(text: string, maxLength: number): string {
27
  if (text.length <= maxLength) {