@@ -7,7 +7,7 @@ import type { Event, MarkerData, SegmentData } from "@/lib/types";
77import { useSettings } from "@/hooks/useSettings" ;
88import { useExport } from "@/hooks/useExport" ;
99import { computeTimeline } from "@/lib/timeline-math" ;
10- import { buildShareablePath } from "@/lib/custom-event-url" ;
10+ import { buildShareablePath , buildUrl } from "@/lib/custom-event-url" ;
1111import EventAutocomplete from "./EventAutocomplete" ;
1212import Timeline from "@/components/Timeline/Timeline" ;
1313import EditableTitle from "@/components/EditableTitle" ;
@@ -23,14 +23,6 @@ interface ChooserProps {
2323 serverHideNow ?: boolean ;
2424}
2525
26- function buildUrl ( path : string , title : string , hideNow : boolean ) : string {
27- const params = new URLSearchParams ( ) ;
28- if ( title ) params . set ( "t" , title ) ;
29- if ( hideNow ) params . set ( "now" , "0" ) ;
30- const qs = params . toString ( ) ;
31- return qs ? `${ path } ?${ qs } ` : path ;
32- }
33-
3426export default function Chooser ( {
3527 selectedEvents,
3628 serverTimeline,
@@ -78,6 +70,7 @@ export default function Chooser({
7870 setTitle ( newTitle ) ;
7971 const path = selected . length > 0 ? `${ localePath } ${ buildShareablePath ( selected ) } ` : `${ localePath } /` ;
8072 window . history . replaceState ( null , "" , buildUrl ( path , newTitle , hideNow ) ) ;
73+ document . title = newTitle ? `${ newTitle } | wiki:closerintime` : "wiki:closerintime" ;
8174 } ,
8275 [ selected , hideNow , localePath ]
8376 ) ;
0 commit comments