Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear presence on window loses focus, in unsupported page, and when idling w/ window focus. #1911

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

lettucegoblin
Copy link

Problem: Considered idling when in non-accounted for workspaces(settings page, any file extension not supported yet)
Solution: Clear presence and release control.

Problem: The extension right now rarely lets go of rpc control. If another RPC based app is running(i.e spotify) it would rarely get the chance to show on discord.  
Solution: New configuration options: discord.clearOnIdleWhenInFocus and discord.clearOnLoseFocus, which control whether the activity should be cleared when the editor is in focus during idle time and when the window loses focus, respectively.

This commit modifies the `extension.ts` file to add functionality for clearing the activity when the window loses focus. It introduces two new configuration options: `discord.clearOnIdleWhenInFocus` and `discord.clearOnLoseFocus`, which control whether the activity should be cleared when the editor is in focus during idle time and when the window loses focus, respectively.
@lettucegoblin lettucegoblin changed the title toggles: Clear presence on window loses focus, in unsupported page, and when idling w/ window focus. Clear presence on window loses focus, in unsupported page, and when idling w/ window focus. Jun 21, 2024
@lettucegoblin lettucegoblin marked this pull request as draft June 21, 2024 17:45
This commit refactors the `extension.ts` file to improve the handling of activity updates and introduces idle timeout functionality. It adds the `handleIdle` function to handle activity clearing based on window focus and idle time. It also introduces the `inputPollingRate` constant to control the rate at which activity is sent when there are text editor changes. Additionally, it modifies the `sendActivity` function to use `await` when setting the activity state. This commit aims to improve the overall performance and user experience of the extension.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant