File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 11import { Show , JSX , Suspense } from 'solid-js' ;
2- import { Router , Route } from '@solidjs/router' ;
2+ import { Router , Route , Navigate } from '@solidjs/router' ;
33import { eventBus , setEventBus } from './utils/serviceWorker' ;
44import { Update } from './components/update' ;
55import { useZoom } from 'solid-repl/src/hooks/useZoom' ;
@@ -27,6 +27,8 @@ export const App = (): JSX.Element => {
2727 }
2828 } ) ;
2929
30+ const searchParams = new URLSearchParams ( window . location . search ) ;
31+
3032 return (
3133 < div class = "dark:bg-solid-darkbg relative flex h-screen flex-col overflow-auto bg-white font-sans text-slate-900 dark:text-slate-50" >
3234 < Router
@@ -40,6 +42,9 @@ export const App = (): JSX.Element => {
4042 </ Router >
4143
4244 < Show when = { eventBus ( ) } children = { < Update onDismiss = { ( ) => setEventBus ( false ) } /> } />
45+ < Show when = { searchParams . has ( "hash" ) } >
46+ < Navigate href = { `/anonymous/${ searchParams . get ( "hash" ) } ` } />
47+ </ Show >
4348 </ div >
4449 ) ;
4550} ;
Original file line number Diff line number Diff line change @@ -105,7 +105,9 @@ export const Edit = () => {
105105 let output : APIRepl ;
106106
107107 if ( repl ) {
108- output = await fetch ( `${ API } /repl/${ repl } ` ) . then ( ( r ) => r . json ( ) ) ;
108+ const data = await fetch ( `${ API } /repl/${ repl } ` ) ;
109+ output = await data . json ( ) ;
110+ navigate ( `/anonymous/${ output . id } ` ) ;
109111 } else {
110112 const myScratchpad = localStorage . getItem ( 'scratchpad' ) ;
111113 if ( ! myScratchpad ) {
You can’t perform that action at this time.
0 commit comments