Skip to content

Commit fa03c08

Browse files
committed
feat(vscode): add global setting to disable What's New notification
Allow users to turn off the update notification that appears after RobotCode has been updated. The new `robotcode.showWhatsNewOnUpdate` setting can be found in the global VS Code settings under RobotCode > General.
1 parent c096d35 commit fa03c08

2 files changed

Lines changed: 19 additions & 10 deletions

File tree

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,12 @@
684684
"id": "robotcode.general",
685685
"type": "object",
686686
"properties": {
687+
"robotcode.showWhatsNewOnUpdate": {
688+
"type": "boolean",
689+
"default": true,
690+
"markdownDescription": "Show a notification with a link to the release notes when RobotCode is updated.",
691+
"scope": "application"
692+
},
687693
"robotcode.disableExtension": {
688694
"type": "boolean",
689695
"default": false,

vscode-client/extension/index.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,19 @@ export async function activateAsync(context: vscode.ExtensionContext): Promise<v
4343
const previousVersion = context.globalState.get<string>("robotcode.lastVersion");
4444

4545
if (previousVersion !== currentVersion) {
46-
vscode.window
47-
.showInformationMessage(
48-
`RobotCode has been updated to v${currentVersion}. Want to know what's new? Click below to see all the latest changes and improvements.`,
49-
"What's New?",
50-
)
51-
.then(async (action) => {
52-
if (action === "What's New?") {
53-
await vscode.commands.executeCommand("robotcode.showWhatsNew");
54-
}
55-
});
46+
const showNotification = vscode.workspace.getConfiguration("robotcode").get<boolean>("showWhatsNewOnUpdate", true);
47+
if (showNotification) {
48+
vscode.window
49+
.showInformationMessage(
50+
`RobotCode has been updated to v${currentVersion}. Want to know what's new? Click below to see all the latest changes and improvements.`,
51+
"What's New?",
52+
)
53+
.then(async (action) => {
54+
if (action === "What's New?") {
55+
await vscode.commands.executeCommand("robotcode.showWhatsNew");
56+
}
57+
});
58+
}
5659
}
5760

5861
context.globalState.update("robotcode.lastVersion", currentVersion);

0 commit comments

Comments
 (0)