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

Commit3fe5b80

Browse files
committed
log tutorial and continue position
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent9d433af commit3fe5b80

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

‎src/actions/onStartup.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Context from '../services/context/context'
55
import{send}from'../commands'
66
import{WORKSPACE_ROOT,TUTORIAL_URL}from'../environment'
77
importfetchfrom'node-fetch'
8+
importloggerfrom'../services/logger'
89

910
constonStartup=async(context:Context):Promise<void>=>{
1011
try{
@@ -36,10 +37,12 @@ const onStartup = async (context: Context): Promise<void> => {
3637
// NEW: no stored tutorial, must start new tutorial
3738
if(!tutorial||!tutorial.version){
3839
if(TUTORIAL_URL){
40+
logger(`Using tutorial url from env:${TUTORIAL_URL}`)
3941
// if a tutorial URL is added, launch on startup
4042
try{
4143
consttutorialRes=awaitfetch(TUTORIAL_URL)
42-
consttutorial=awaittutorialRes.json()
44+
consttutorial:TT.Tutorial=awaittutorialRes.json()
45+
logger(`Tutorial:${tutorial?.summary?.title} (${tutorial?.version})`)
4346
send({type:'START_TUTORIAL_FROM_URL',payload:{ tutorial}})
4447
return
4548
}catch(e:any){
@@ -54,6 +57,7 @@ const onStartup = async (context: Context): Promise<void> => {
5457

5558
// CONTINUE_FROM_PROGRESS
5659
const{ position}=awaitcontext.onContinue(tutorial)
60+
logger(`Continuing tutorial from progress: level${position?.levelId} step${position?.stepId}`)
5761
// communicate to client the tutorial & stepProgress state
5862
send({type:'LOAD_STORED_TUTORIAL',payload:{ env, tutorial, position}})
5963
}catch(e:any){

‎src/actions/onTutorialConfigContinue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import logger from '../services/logger'
88
import{setupWebhook}from'../services/hooks/webhooks'
99

1010
constonTutorialConfigContinue=async(action:T.Action,context:Context):Promise<void>=>{
11-
logger(`Continuing tutorial from progress:${JSON.stringify(action.payload)}`)
1211
try{
1312
consttutorialToContinue:TT.Tutorial|null=context.tutorial.get()
13+
logger(`Tutorial:${tutorialToContinue?.summary?.title} (${tutorialToContinue?.version})`)
1414
if(!tutorialToContinue){
1515
thrownewError('Invalid tutorial to continue')
1616
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp