-
-
Notifications
You must be signed in to change notification settings - Fork 607
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added option to disable restart message.
References #225
- Loading branch information
Showing
11 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,37 @@ | ||
import * as vscode from 'vscode'; | ||
import * as i18n from './../i18n'; | ||
import * as helpers from './../helpers'; | ||
|
||
/** User has to confirm if he wants to reload the editor */ | ||
export const showConfirmToReloadMessage = (): Promise<boolean> => { | ||
return new Promise((resolve, reject) => { | ||
// if the user does not want to see the reload message | ||
if (helpers.getThemeConfig('showReloadMessage').globalValue === false) return; | ||
|
||
vscode.window.showInformationMessage( | ||
i18n.translate('confirmReload'), | ||
i18n.translate('reload') | ||
i18n.translate('reload'), | ||
i18n.translate('neverShowAgain') | ||
).then(value => { | ||
if (value === i18n.translate('reload')) resolve(true); | ||
else resolve(false); | ||
switch (value) { | ||
case i18n.translate('reload'): | ||
resolve(true); | ||
break; | ||
|
||
case i18n.translate('neverShowAgain'): | ||
disableReloadMessage(); | ||
resolve(false); | ||
break; | ||
|
||
default: | ||
resolve(false); | ||
break; | ||
} | ||
}); | ||
}); | ||
}; | ||
|
||
/** Disable the reload message in the global settings */ | ||
const disableReloadMessage = () => { | ||
helpers.setThemeConfig('showReloadMessage', false, true); | ||
}; |