File tree Expand file tree Collapse file tree 4 files changed +11
-1
lines changed Expand file tree Collapse file tree 4 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 691
691
"default" : false ,
692
692
"description" : " Suppresses all notifications from the extension."
693
693
},
694
+ "vscord.behaviour.supressRpcCouldNotConnect" : {
695
+ "type" : " boolean" ,
696
+ "default" : false ,
697
+ "description" : " Suppresses \" RPC_COULD_NOT_CONNECT\" notification."
698
+ },
694
699
"vscord.behaviour.prioritizeLanguagesOverExtensions" : {
695
700
"type" : " boolean" ,
696
701
"default" : false ,
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ export interface ExtensionConfigurationType {
109
109
"file.size.spacer" : string ;
110
110
"behaviour.additionalFileMapping" : Record < string , string > ;
111
111
"behaviour.suppressNotifications" : boolean ;
112
+ "behaviour.supressRpcCouldNotConnect" : boolean ;
112
113
"behaviour.prioritizeLanguagesOverExtensions" : boolean ;
113
114
"behaviour.statusBarAlignment" : "Left" | "Right" ;
114
115
"behaviour.debug" : boolean ;
Original file line number Diff line number Diff line change @@ -201,6 +201,7 @@ export const CONFIG_KEYS = {
201
201
Behaviour : {
202
202
AdditionalFileMapping : "behaviour.additionalFileMapping" as const ,
203
203
SuppressNotifications : "behaviour.suppressNotifications" as const ,
204
+ SuppressRpcCouldNotConnect : "behaviour.supressRpcCouldNotConnect" as const ,
204
205
PrioritizeLanguagesOverExtensions : "behaviour.prioritizeLanguagesOverExtensions" as const ,
205
206
StatusBarAlignment : "behaviour.statusBarAlignment" as const ,
206
207
Debug : "behaviour.debug" as const
Original file line number Diff line number Diff line change @@ -36,8 +36,11 @@ export class RPCController {
36
36
37
37
logError ( "Encountered following error while trying to login:" , error ) ;
38
38
editor . setStatusBarItem ( StatusBarMode . Disconnected ) ;
39
- if ( ! config . get ( CONFIG_KEYS . Behaviour . SuppressNotifications ) )
39
+ if ( ! config . get ( CONFIG_KEYS . Behaviour . SuppressNotifications ) &&
40
+ ( error . name !== "RPC_COULD_NOT_CONNECT" || ! config . get ( CONFIG_KEYS . Behaviour . SuppressRpcCouldNotConnect ) )
41
+ ) {
40
42
window . showErrorMessage ( "Failed to connect to Discord Gateway" ) ;
43
+ }
41
44
await this . client ?. destroy ( ) ;
42
45
logInfo ( "[002] Destroyed Discord RPC client" ) ;
43
46
} ) ;
You can’t perform that action at this time.
0 commit comments