Skip to content

Commit a925cbd

Browse files
committed
Add a persistent state check for the pre-release prompt so it doesn't pop up constantly
1 parent 4d14df9 commit a925cbd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Extension/src/LanguageServer/extension.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,8 +1165,10 @@ export function UpdateInsidersAccess(): void {
11651165
}
11661166

11671167
export async function preReleaseCheck(): Promise<void> {
1168-
// First we need to make sure the user isn't already on a pre-release version.
1169-
if (util.getCppToolsTargetPopulation() === TargetPopulation.Public) {
1168+
const displayedPreReleasePrompt: PersistentState<boolean> = new PersistentState<boolean>("CPP.displayedPreReleasePrompt", false);
1169+
1170+
// First we need to make sure the user isn't already on a pre-release version and hasn't dismissed this prompt before.
1171+
if (!displayedPreReleasePrompt.Value && util.getCppToolsTargetPopulation() === TargetPopulation.Public) {
11701172
// Get the info on the latest version from the marketplace to check if there is a pre-release version available.
11711173
const response = await fetch('https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery', {
11721174
method: 'POST',
@@ -1182,6 +1184,7 @@ export async function preReleaseCheck(): Promise<void> {
11821184

11831185
// If the user isn't on the pre-release version, but one is available, prompt them to install it.
11841186
if (preReleaseAvailable) {
1187+
displayedPreReleasePrompt.Value = true;
11851188
const message: string = localize("prerelease.message", "There is a new pre-release version of the C/C++ extension, would you like to install it?");
11861189
const yes: string = localize("yes.button", "Yes");
11871190
const no: string = localize("no.button", "No");

0 commit comments

Comments
 (0)