@@ -3,33 +3,32 @@ import React from 'react'
3
3
import './index.css'
4
4
import { ThemeModule } from './app/tabs/theme-module'
5
5
import { Preload } from './app/components/preload'
6
- import { BrowserRouter , Routes , Route } from 'react-router-dom'
7
6
import { GitHubPopupCallback } from './app/pages/GitHubPopupCallback'
8
7
import Config from './config'
9
8
import { Registry } from '@remix-project/remix-lib'
10
9
import { Storage } from '@remix-project/remix-lib'
11
10
12
11
import { createRoot } from 'react-dom/client'
13
12
14
- ; ( async function ( ) {
15
- try {
16
- const configStorage = new Storage ( 'config-v0.8:' )
17
- const config = new Config ( configStorage )
18
- Registry . getInstance ( ) . put ( { api : config , name : 'config' } )
19
- } catch ( e ) { }
20
- const theme = new ThemeModule ( )
21
- theme . initTheme ( )
13
+ ; ( async function ( ) {
14
+ try {
15
+ const configStorage = new Storage ( 'config-v0.8:' )
16
+ const config = new Config ( configStorage )
17
+ Registry . getInstance ( ) . put ( { api : config , name : 'config' } )
18
+ } catch ( e ) { }
19
+ const theme = new ThemeModule ( )
20
+ theme . initTheme ( )
22
21
23
- const container = document . getElementById ( 'root' ) ;
24
- const root = createRoot ( container )
25
- if ( container ) {
26
- root . render (
27
- < BrowserRouter >
28
- < Routes >
29
- < Route path = "/auth/github/callback" element = { < GitHubPopupCallback /> } />
30
- < Route path = "*" element = { < Preload root = { root } /> } />
31
- </ Routes >
32
- </ BrowserRouter >
33
- )
34
- }
35
- } ) ( )
22
+ const container = document . getElementById ( 'root' ) ;
23
+ const root = createRoot ( container )
24
+ if ( container ) {
25
+ if ( window . location . hash . includes ( 'source=github' ) ) {
26
+ root . render (
27
+ < GitHubPopupCallback / >
28
+ )
29
+ } else {
30
+ root . render (
31
+ < Preload root = { root } /> )
32
+ }
33
+ }
34
+ } ) ( )
0 commit comments