Skip to content

Commit

Permalink
Show the quickstart without prompting in c9 (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryceitoc9 authored Nov 11, 2020
1 parent 1066888 commit 5fd43f3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
1 change: 1 addition & 0 deletions README.quickstart.cloud9.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ See [Setup](#additional-setup-steps) for installation requirements, or [Get help
- [AWS Explorer](#ui-components-aws-expl)
- CloudFormation stacks
- Lambda functions
- S3 explorer
- [AWS Serverless Applications (SAM)](#sam-and-lambda)
- [`AWS:` Commands](#aws-commands)

Expand Down
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -690,10 +690,6 @@
{
"command": "aws.stepfunctions.publishStateMachine",
"when": "!isCloud9"
},
{
"command": "aws.quickStart",
"when": "!isCloud9"
}
],
"editor/title": [
Expand Down Expand Up @@ -758,7 +754,7 @@
},
{
"command": "aws.quickStart",
"when": "view == aws.explorer && !isCloud9",
"when": "view == aws.explorer",
"group": "y_quickStart@1"
},
{
Expand Down
4 changes: 1 addition & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,7 @@ export async function activate(context: vscode.ExtensionContext) {
})
}

if (!isCloud9()) {
showWelcomeMessage(context)
}
showWelcomeMessage(context)

await loginWithMostRecentCredentials(toolkitSettings, loginManager)

Expand Down
30 changes: 17 additions & 13 deletions src/shared/extensionUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,24 @@ export function setMostRecentVersion(context: vscode.ExtensionContext): void {

/**
* Shows a message with a link to the quickstart page.
* In cloud9, directly opens quickstart instead
*/
async function showQuickstartPrompt(): Promise<void> {
const view = localize('AWS.command.quickStart', 'View Quick Start')
const prompt = await vscode.window.showInformationMessage(
localize(
'AWS.message.prompt.quickStart.toastMessage',
'You are now using AWS Toolkit version {0}',
pluginVersion
),
view
)
if (prompt === view) {
async function showOrPromptQuickstart(): Promise<void> {
if (isCloud9()) {
vscode.commands.executeCommand('aws.quickStart')
} else {
const view = localize('AWS.command.quickStart', 'View Quick Start')
const prompt = await vscode.window.showInformationMessage(
localize(
'AWS.message.prompt.quickStart.toastMessage',
'You are now using AWS Toolkit version {0}',
pluginVersion
),
view
)
if (prompt === view) {
vscode.commands.executeCommand('aws.quickStart')
}
}
}

Expand All @@ -262,13 +267,12 @@ export function showWelcomeMessage(context: vscode.ExtensionContext): void {
)
return
}

try {
if (isDifferentVersion(context)) {
setMostRecentVersion(context)
// the welcome toast should be nonblocking.
// tslint:disable-next-line: no-floating-promises
showQuickstartPrompt()
showOrPromptQuickstart()
}
} catch (err) {
// swallow error and don't block extension load
Expand Down

0 comments on commit 5fd43f3

Please sign in to comment.