66import * as vscode from "vscode" ;
77import OptionProvider from "../observers/OptionProvider" ;
88
9+ const DecompilationAuthorizedOption = "csharp.decompilationAuthorized" ;
10+
911export async function resetDecompilationAuthorization ( context : vscode . ExtensionContext ) {
10- context . globalState . update ( "csharp.decompilationAuthorized" , undefined ) ;
12+ context . globalState . update ( DecompilationAuthorizedOption , undefined ) ;
1113}
1214
1315export async function getDecompilationAuthorization ( context : vscode . ExtensionContext , optionProvider : OptionProvider ) {
@@ -18,17 +20,17 @@ export async function getDecompilationAuthorization(context: vscode.ExtensionCon
1820 }
1921
2022 // If the terms have been acknowledged, then return whether it was authorized.
21- let decompilationAutorized = context . globalState . get < boolean | undefined > ( "csharp.decompilationAuthorized" ) ;
22- if ( decompilationAutorized !== undefined ) {
23- return decompilationAutorized ;
23+ let decompilationAuthorized = context . globalState . get < boolean | undefined > ( DecompilationAuthorizedOption ) ;
24+ if ( decompilationAuthorized !== undefined ) {
25+ return decompilationAuthorized ;
2426 }
2527
2628 const result = await promptToAcceptDecompilationTerms ( ) ;
27- decompilationAutorized = result === PromptResult . Yes ;
29+ decompilationAuthorized = result === PromptResult . Yes ;
2830
29- await context . globalState . update ( "csharp.decompilationAuthorized" , decompilationAutorized ) ;
31+ await context . globalState . update ( DecompilationAuthorizedOption , decompilationAuthorized ) ;
3032
31- return decompilationAutorized ;
33+ return decompilationAuthorized ;
3234}
3335
3436enum PromptResult {
0 commit comments