8000 Merge pull request #410 from coderoad/fix/launch-continue-from-url · ShaunSHamilton/coderoad-vscode@a82a207 · GitHub
[go: up one dir, main page]

Skip to content
  • Commit a82a207

    Browse files
    authored
    Merge pull request coderoad#410 from coderoad/fix/launch-continue-from-url
    continue from launched url
    2 parents d4b4dae + 0395753 commit a82a207

    File tree

    1 file changed

    +13
    -13
    lines changed

    1 file changed

    +13
    -13
    lines changed

    src/actions/onStartup.ts

    Lines changed: 13 additions & 13 deletions
    Original file line numberDiff line numberDiff line change
    @@ -35,24 +35,24 @@ const onStartup = async (
    3535
    sessionId: vscode.env.sessionId,
    3636
    }
    3737

    38-
    // load tutorial from url
    39-
    if (TUTORIAL_URL) {
    40-
    try {
    41-
    const tutorialRes = await fetch(TUTORIAL_URL)
    42-
    const tutorial = await tutorialRes.json()
    43-
    send({ type: 'START_TUTORIAL_FROM_URL', payload: { tutorial } })
    44-
    return
    45-
    } catch (e) {
    46-
    console.log(`Failed to load tutorial from url ${TUTORIAL_URL} with error "${e.message}"`)
    47-
    }
    48-
    }
    49-
    5038
    // continue from tutorial from local storage
    5139
    const tutorial: TT.Tutorial | null = context.tutorial.get()
    5240

    5341
    // no stored tutorial, must start new tutorial
    5442
    if (!tutorial || !tutorial.id) {
    55-
    send({ type: 'START_NEW_TUTORIAL', payload: { env } })
    43+
    if (TUTORIAL_URL) {
    44+
    // launch from a url env variable
    45+
    try {
    46+
    const tutorialRes = await fetch(TUTORIAL_URL)
    47+
    const tutorial = await tutorialRes.json()
    48+
    send({ type: 'START_TUTORIAL_FROM_URL', payload: { tutorial } })
    49+
    } catch (e) {
    50+
    console.log(`Failed to load tutorial from url ${TUTORIAL_URL} with error "${e.message}"`)
    51+
    }
    52+
    } else {
    53+
    // launch from a selected tutorial
    54+
    send({ type: 'START_NEW_TUTORIAL', payload: { env } })
    55+
    }
    5656
    return
    5757
    }
    5858

    0 commit comments

    Comments
     (0)
    0