@@ -43,8 +43,12 @@ export async function activate(context: vscode.ExtensionContext) {
43
43
vscode . window . createTerminal ( ) ;
44
44
}
45
45
} ) ;
46
+
47
+ const versionKey = 'walkthrough.version' ;
48
+ context . globalState . setKeysForSync ( [ versionKey ] ) ;
49
+
46
50
registerWelcomeWalkthroughCommands ( gitpodContext ) ;
47
- startWelcomeWalkthrough ( ) ;
51
+ startWelcomeWalkthrough ( context , versionKey ) ;
48
52
49
53
const codeServer = new GitpodCodeServer ( ) ;
50
54
registerCLI ( codeServer , gitpodContext ) ;
@@ -769,10 +773,17 @@ export function registerWelcomeWalkthroughCommands(context: GitpodExtensionConte
769
773
} ) ) ;
770
774
}
771
775
772
- export function startWelcomeWalkthrough ( ) {
773
- if ( vscode . window . visibleTextEditors . length === 0 ) {
774
- vscode . commands . executeCommand ( 'workbench.action.openWalkthrough' , 'gitpod.gitpod-web#gitpod-getstarted' , false ) ;
776
+ export function startWelcomeWalkthrough ( context : vscode . ExtensionContext , versionKey : string ) : void {
777
+ type WalkthroughVersion = 0.1 ;
778
+ const currentVersion : WalkthroughVersion = 0.1 ;
779
+ const lastVersionShown = context . globalState . get < number > ( versionKey ) ;
780
+
781
+ if ( typeof lastVersionShown === 'number' || vscode . window . visibleTextEditors . length !== 0 ) {
782
+ return ;
775
783
}
784
+
785
+ context . globalState . update ( versionKey , currentVersion ) ;
786
+ vscode . commands . executeCommand ( 'workbench.action.openWalkthrough' , 'gitpod.gitpod-web#gitpod-getstarted' , false ) ;
776
787
}
777
788
778
789
export function registerCLI ( codeServer : GitpodCodeServer , context : GitpodExtensionContext ) : void {
0 commit comments