Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
d29c40dc
Unverified
Commit
d29c40dc
authored
Feb 17, 2023
by
boojack
Committed by
GitHub
Feb 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update router loader (#1102)
parent
4f5f541e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
20 deletions
+29
-20
SystemSection.tsx
web/src/components/Settings/SystemSection.tsx
+0
-4
i18n.ts
web/src/i18n.ts
+1
-1
index.tsx
web/src/router/index.tsx
+28
-15
No files found.
web/src/components/Settings/SystemSection.tsx
View file @
d29c40dc
...
@@ -157,10 +157,6 @@ const SystemSection = () => {
...
@@ -157,10 +157,6 @@ const SystemSection = () => {
<
span
className=
"normal-text"
>
{
t
(
"setting.system-section.disable-public-memos"
)
}
</
span
>
<
span
className=
"normal-text"
>
{
t
(
"setting.system-section.disable-public-memos"
)
}
</
span
>
<
Switch
checked=
{
state
.
disablePublicMemos
}
onChange=
{
(
event
)
=>
handleDisablePublicMemosChanged
(
event
.
target
.
checked
)
}
/>
<
Switch
checked=
{
state
.
disablePublicMemos
}
onChange=
{
(
event
)
=>
handleDisablePublicMemosChanged
(
event
.
target
.
checked
)
}
/>
</
div
>
</
div
>
<
div
className=
"form-label"
>
<
span
className=
"normal-text"
>
Storage
</
span
>
<
Switch
checked=
{
state
.
disablePublicMemos
}
onChange=
{
(
event
)
=>
handleDisablePublicMemosChanged
(
event
.
target
.
checked
)
}
/>
</
div
>
<
Divider
className=
"!mt-3 !my-4"
/>
<
Divider
className=
"!mt-3 !my-4"
/>
<
div
className=
"form-label"
>
<
div
className=
"form-label"
>
<
span
className=
"normal-text"
>
{
t
(
"setting.system-section.additional-style"
)
}
</
span
>
<
span
className=
"normal-text"
>
{
t
(
"setting.system-section.additional-style"
)
}
</
span
>
...
...
web/src/i18n.ts
View file @
d29c40dc
...
@@ -52,7 +52,7 @@ i18n.use(initReactI18next).init({
...
@@ -52,7 +52,7 @@ i18n.use(initReactI18next).init({
translation
:
hantLocale
,
translation
:
hantLocale
,
},
},
},
},
lng
:
"
nl
"
,
lng
:
"
en
"
,
fallbackLng
:
"en"
,
fallbackLng
:
"en"
,
});
});
...
...
web/src/router/index.tsx
View file @
d29c40dc
...
@@ -11,16 +11,28 @@ const MemoDetail = lazy(() => import("../pages/MemoDetail"));
...
@@ -11,16 +11,28 @@ const MemoDetail = lazy(() => import("../pages/MemoDetail"));
const
EmbedMemo
=
lazy
(()
=>
import
(
"../pages/EmbedMemo"
));
const
EmbedMemo
=
lazy
(()
=>
import
(
"../pages/EmbedMemo"
));
const
NotFound
=
lazy
(()
=>
import
(
"../pages/NotFound"
));
const
NotFound
=
lazy
(()
=>
import
(
"../pages/NotFound"
));
const
router
=
createBrowserRouter
([
const
initialGlobalStateLoader
=
(()
=>
{
{
let
done
=
false
;
path
:
"/auth"
,
element
:
<
Auth
/>,
return
async
()
=>
{
loader
:
async
()
=>
{
if
(
done
)
{
return
;
}
done
=
true
;
try
{
try
{
await
initialGlobalState
();
await
initialGlobalState
();
}
catch
(
error
)
{
}
catch
(
error
)
{
// do nth
// do nth
}
}
};
})();
const
router
=
createBrowserRouter
([
{
path
:
"/auth"
,
element
:
<
Auth
/>,
loader
:
async
()
=>
{
await
initialGlobalStateLoader
();
return
null
;
return
null
;
},
},
},
},
...
@@ -28,8 +40,9 @@ const router = createBrowserRouter([
...
@@ -28,8 +40,9 @@ const router = createBrowserRouter([
path
:
"/"
,
path
:
"/"
,
element
:
<
Home
/>,
element
:
<
Home
/>,
loader
:
async
()
=>
{
loader
:
async
()
=>
{
await
initialGlobalStateLoader
();
try
{
try
{
await
initialGlobalState
();
await
initialUserState
();
await
initialUserState
();
}
catch
(
error
)
{
}
catch
(
error
)
{
// do nth
// do nth
...
@@ -48,8 +61,9 @@ const router = createBrowserRouter([
...
@@ -48,8 +61,9 @@ const router = createBrowserRouter([
path
:
"/u/:userId"
,
path
:
"/u/:userId"
,
element
:
<
Home
/>,
element
:
<
Home
/>,
loader
:
async
()
=>
{
loader
:
async
()
=>
{
await
initialGlobalStateLoader
();
try
{
try
{
await
initialGlobalState
();
await
initialUserState
();
await
initialUserState
();
}
catch
(
error
)
{
}
catch
(
error
)
{
// do nth
// do nth
...
@@ -66,8 +80,9 @@ const router = createBrowserRouter([
...
@@ -66,8 +80,9 @@ const router = createBrowserRouter([
path
:
"/explore"
,
path
:
"/explore"
,
element
:
<
Explore
/>,
element
:
<
Explore
/>,
loader
:
async
()
=>
{
loader
:
async
()
=>
{
await
initialGlobalStateLoader
();
try
{
try
{
await
initialGlobalState
();
await
initialUserState
();
await
initialUserState
();
}
catch
(
error
)
{
}
catch
(
error
)
{
// do nth
// do nth
...
@@ -84,8 +99,9 @@ const router = createBrowserRouter([
...
@@ -84,8 +99,9 @@ const router = createBrowserRouter([
path
:
"/m/:memoId"
,
path
:
"/m/:memoId"
,
element
:
<
MemoDetail
/>,
element
:
<
MemoDetail
/>,
loader
:
async
()
=>
{
loader
:
async
()
=>
{
await
initialGlobalStateLoader
();
try
{
try
{
await
initialGlobalState
();
await
initialUserState
();
await
initialUserState
();
}
catch
(
error
)
{
}
catch
(
error
)
{
// do nth
// do nth
...
@@ -102,8 +118,9 @@ const router = createBrowserRouter([
...
@@ -102,8 +118,9 @@ const router = createBrowserRouter([
path
:
"/m/:memoId/embed"
,
path
:
"/m/:memoId/embed"
,
element
:
<
EmbedMemo
/>,
element
:
<
EmbedMemo
/>,
loader
:
async
()
=>
{
loader
:
async
()
=>
{
await
initialGlobalStateLoader
();
try
{
try
{
await
initialGlobalState
();
await
initialUserState
();
await
initialUserState
();
}
catch
(
error
)
{
}
catch
(
error
)
{
// do nth
// do nth
...
@@ -115,11 +132,7 @@ const router = createBrowserRouter([
...
@@ -115,11 +132,7 @@ const router = createBrowserRouter([
path
:
"*"
,
path
:
"*"
,
element
:
<
NotFound
/>,
element
:
<
NotFound
/>,
loader
:
async
()
=>
{
loader
:
async
()
=>
{
try
{
await
initialGlobalStateLoader
();
await
initialGlobalState
();
}
catch
(
error
)
{
// do nth
}
return
null
;
return
null
;
},
},
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment