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

Fixes#7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ShMcK merged 3 commits intomasterfromfixes
Jun 13, 2019
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
initialize position
  • Loading branch information
@ShMcK
ShMcK committedJun 13, 2019
commit893eca7c7def9dd1923c9f4d2ed2a886fd79abba
13 changes: 13 additions & 0 deletionssrc/state/actions/index.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,6 +51,19 @@ export default {
vscode.commands.executeCommand('coderoad.tutorial_setup', currentTutorial)
vscode.commands.executeCommand('coderoad.open_webview', vscode.ViewColumn.Two)
},
initializeNewTutorial: assign({
position: (context: any): CR.Position => {
const { data } = context
const levelId = data.summary.levelList[0]
const stageId = data.levels[levelId].stageList[0]
const stepId = data.stages[stageId].stepList[0]
return {
levelId,
stageId,
stepId
}
}
}),
tutorialContinue: assign({
// load initial data, progress & position
data(): CR.TutorialData {
Expand Down
8 changes: 7 additions & 1 deletionsrc/state/machine.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -57,9 +57,15 @@ export const machine = Machine<
},
Tutorial: {
id: 'tutorial',
initial: 'Summary',
initial: 'Initialize',
onEntry: ['tutorialSetup'],
states: {
Initialize: {
onEntry: ['initializeNewTutorial'],
after: {
0: 'Summary'
}
},
LoadNext: {
id: 'tutorial-load-next',
onEntry: ['tutorialLoadNext'],
Expand Down
1 change: 1 addition & 0 deletionstypings/index.d.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,6 +146,7 @@ export interface MachineStateSchema {
}
Tutorial:{
states:{
Initialize:{}
Summary:{}
LoadNext:{}
Level:{}
Expand Down
2 changes: 1 addition & 1 deletionweb-app/src/containers/Tutorial/SummaryPage.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@ interface PageProps {

constSummaryPage=(props:PageProps)=>{
const{ data}=React.useContext(DataContext)
return<Summarydata={data}onNext={()=>props.send('LOAD_NEXT')}/>
return<Summarydata={data}onNext={()=>props.send('NEXT')}/>
}

exportdefaultSummaryPage

[8]ページ先頭

©2009-2025 Movatter.jp