leonardssh / vscord

😎 Fully customizable VS Code extension to get Discord Rich Presence integration.
https://marketplace.visualstudio.com/items?itemName=LeonardSSH.vscord
MIT License
478 stars 95 forks source link

Fix(#162): `DisconnectOnIdle` doesn't restore presence #319

Open Sominemo opened 2 months ago

Sominemo commented 2 months ago

This pull request fixes a problem which caused DisconnectOnIdle option to never re-connect RPC after disconnecting due to some refactoring that happened in the extension shortly after I implemented the option.

Instead of calling .disable(), I modified checkCanSend to disallow presence when idling if the option is enabled. A subtle improvement to how timer resets after idling was also needed.

Additionally to this, I added some explanations on what idle-related settings do exactly, as they sounded kinda similar and it wasn't clear what they did exactly.

https://github.com/leonardssh/vscord/assets/19842935/aa59a8e8-4223-4545-8502-2fe0771fb198