File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,9 +57,10 @@ function App() {
5757 const [ sidebarVisible , setSidebarVisible ] = useState ( true ) ;
5858 const savingDisabledRef = useRef ( false ) ;
5959
60- // Load config from URL if present
60+ // Load config from URL hash if present
6161 useEffect ( ( ) => {
62- const params = new URLSearchParams ( window . location . search ) ;
62+ const hash = window . location . hash . slice ( 1 ) ; // remove leading '#'
63+ const params = new URLSearchParams ( hash ) ;
6364 const cfg = params . get ( 'config' ) ;
6465 if ( cfg ) {
6566 const data = decodeConfig ( cfg ) ;
@@ -198,7 +199,7 @@ function App() {
198199
199200 const handleShareConfig = useCallback ( ( ) => {
200201 const data = encodeConfig ( { globalParsingConfig, uploadedFiles } ) ;
201- const url = `${ window . location . origin } ${ window . location . pathname } ? config=${ data } ` ;
202+ const url = `${ window . location . origin } ${ window . location . pathname } # config=${ data } ` ;
202203 if ( navigator ?. clipboard ?. writeText ) {
203204 navigator . clipboard . writeText ( url ) . then ( ( ) => {
204205 alert ( t ( 'shareConfig.copied' ) ) ;
You can’t perform that action at this time.
0 commit comments