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 1
1
import { Show , JSX , Suspense } from 'solid-js' ;
2
- import { Router , Route } from '@solidjs/router' ;
2
+ import { Router , Route , Navigate } from '@solidjs/router' ;
3
3
import { eventBus , setEventBus } from './utils/serviceWorker' ;
4
4
import { Update } from './components/update' ;
5
5
import { useZoom } from 'solid-repl/src/hooks/useZoom' ;
@@ -27,6 +27,8 @@ export const App = (): JSX.Element => {
27
27
}
28
28
} ) ;
29
29
30
+ const searchParams = new URLSearchParams ( window . location . search ) ;
31
+
30
32
return (
31
33
< 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" >
32
34
< Router
@@ -40,6 +42,9 @@ export const App = (): JSX.Element => {
40
42
</ Router >
41
43
42
44
< Show when = { eventBus ( ) } children = { < Update onDismiss = { ( ) => setEventBus ( false ) } /> } />
45
+ < Show when = { searchParams . has ( "hash" ) } >
46
+ < Navigate href = { `/anonymous/${ searchParams . get ( "hash" ) } ` } />
47
+ </ Show >
43
48
</ div >
44
49
) ;
45
50
} ;
Original file line number Diff line number Diff line change @@ -105,7 +105,9 @@ export const Edit = () => {
105
105
let output : APIRepl ;
106
106
107
107
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 } ` ) ;
109
111
} else {
110
112
const myScratchpad = localStorage . getItem ( 'scratchpad' ) ;
111
113
if ( ! myScratchpad ) {
You can’t perform that action at this time.
0 commit comments