Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitce08fa6

Browse files
committed
fix router edge case
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent4de3c42 commitce08fa6

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

‎web-app/src/Routes.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import SelectTutorialPage from './containers/SelectTutorial'
88
importCompletedPagefrom'./containers/Tutorial/CompletedPage'
99
importTutorialPagefrom'./containers/Tutorial'
1010

11+
/*
12+
* NOTE: due to a lack of URLs and a dependency on xstate
13+
* we have to implement a custom router here
14+
*/
1115
constRoutes=()=>{
1216
const{ context, route, send}=useStateMachine()
1317

@@ -35,7 +39,7 @@ const Routes = () => {
3539
<Routepaths={{Tutorial:{Level:{Load:true}}}}>
3640
<LoadingPagetext="Loading Level..."processes={context.processes}/>
3741
</Route>
38-
<Routepaths={{Tutorial:{LoadNext:true,Level:true}}}>
42+
<Routepaths={{Tutorial:{Level:true}}}>
3943
<TutorialPagesend={send}context={context}/>
4044
</Route>
4145
{/* Completed */}

‎web-app/src/components/Router/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ const matches = (route: string, paths: object): boolean => {
1515
for(constkeyofkeys){
1616
constnext=current[key]
1717
if(next){
18+
// exit early if property value is true
19+
if(next===true){
20+
returntrue
21+
}
1822
current=next
1923
continue
2024
}else{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp