Skip to content

Commit

Permalink
fix: a bug with reconnecting
Browse files Browse the repository at this point in the history
  • Loading branch information
xhayper committed Dec 25, 2022
1 parent 98db028 commit 04ee4ec
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vscord",
"displayName": "Discord Rich Presence",
"version": "5.0.16",
"version": "5.0.17",
"description": "Highly customizable Discord Rich Presence extension for Visual Studio Code",
"main": "dist/extension.js",
"repository": "github:LeonardSSH/vscord",
Expand Down Expand Up @@ -47,7 +47,7 @@
"@types/git-url-parse": "^9.0.1",
"@types/node": "16.x",
"@types/vscode": "1.57.0",
"@xhayper/discord-rpc": "^1.0.14",
"@xhayper/discord-rpc": "^1.0.15",
"discord-api-types": "^0.37.24",
"filesize": "^10.0.6",
"git-url-parse": "^13.1.0",
Expand All @@ -62,32 +62,32 @@
"commands": [
{
"command": "vscord.enable",
"title": "Enable Discord Presence.",
"title": "Enable Discord Presence",
"category": "VSCord"
},
{
"command": "vscord.disable",
"title": "Disable Discord Presence.",
"title": "Disable Discord Presence",
"category": "VSCord"
},
{
"command": "vscord.workspace.enable",
"title": "Enable Discord Presence in the current workspace.",
"title": "Enable Discord Presence in the current workspace",
"category": "VSCord"
},
{
"command": "vscord.workspace.disable",
"title": "Disable Discord Presence in the current workspace.",
"title": "Disable Discord Presence in the current workspace",
"category": "VSCord"
},
{
"command": "vscord.disconnect",
"title": "Disconnect from Discord Gateway.",
"title": "Disconnect from Discord Gateway",
"category": "VSCord"
},
{
"command": "vscord.reconnect",
"title": "Reconnect to Discord Gateway.",
"title": "Reconnect to Discord Gateway",
"category": "VSCord"
}
],
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ export class RPCController {

if (!config.get(CONFIG_KEYS.Behaviour.SuppressNotifications)) {
error?.message?.includes("ENOENT")
? void window.showErrorMessage("No Discord client detected")
? void window.showErrorMessage("VSCord\nNo Discord client detected")
: void window.showErrorMessage(
`Couldn't connect to Discord via RPC:\n${error.stack ?? error.message}`
`VSCord\nCouldn't connect to Discord via RPC:\n${error.stack ?? error.message}`
);
}

Expand Down
12 changes: 6 additions & 6 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,26 @@ export const registerCommands = (ctx: ExtensionContext) => {
logInfo("Enabled Discord Rich Presence.");

if (!config.get(CONFIG_KEYS.Behaviour.SuppressNotifications))
await window.showInformationMessage("Enabled Discord Rich Presence.");
await window.showInformationMessage("VSCord\nEnabled Discord Rich Presence");
});

const disableCommand = commands.registerCommand("vscord.disable", async () => {
await disable(false);

logInfo("Disabled Discord Rich Presence.");
logInfo("Disabled Discord Rich Presence");

if (!config.get(CONFIG_KEYS.Behaviour.SuppressNotifications))
await window.showInformationMessage("Disabled Discord Rich Presence.");
await window.showInformationMessage("VSCord\nDisabled Discord Rich Presence");
});

const enableWorkspaceCommand = commands.registerCommand("vscord.workspace.enable", async () => {
await disable();
await enable();

logInfo("Enabled Discord Rich Presence for this workspace.");
logInfo("Enabled Discord Rich Presence for this workspace");

if (!config.get(CONFIG_KEYS.Behaviour.SuppressNotifications))
await window.showInformationMessage("Enabled Discord Rich Presence for this workspace.");
await window.showInformationMessage("VSCord\nEnabled Discord Rich Presence for this workspace");
});

const disableWorkspaceCommand = commands.registerCommand("vscord.workspace.disable", async () => {
Expand All @@ -89,7 +89,7 @@ export const registerCommands = (ctx: ExtensionContext) => {
logInfo("Disabled Discord Rich Presence for this workspace.");

if (!config.get(CONFIG_KEYS.Behaviour.SuppressNotifications))
await window.showInformationMessage("Disabled Discord Rich Presence for this workspace.");
await window.showInformationMessage("VSCord\nDisabled Discord Rich Presence for this workspace");
});

const reconnectCommand = commands.registerCommand("vscord.reconnect", async () => {
Expand Down

0 comments on commit 04ee4ec

Please sign in to comment.