Skip to content

Stop loading overlay when extension is disabled#29

Merged
Shantanugupta43 merged 1 commit intoShantanugupta43:mainfrom
terminalchai:fix/hide-thinking-when-disabled
Mar 31, 2026
Merged

Stop loading overlay when extension is disabled#29
Shantanugupta43 merged 1 commit intoShantanugupta43:mainfrom
terminalchai:fix/hide-thinking-when-disabled

Conversation

@terminalchai
Copy link
Copy Markdown
Contributor

Closes #18

Summary

Prevents the content script from showing the temporary "Thinking..." overlay when the extension has been disabled.

Changes

  • load the stored extensionEnabled state when the content script initializes
  • short-circuit debounced suggestion generation when the extension is off
  • short-circuit request dispatch when the extension is off
  • clear pending debounce timers and hide the overlay immediately when the popup toggle disables the extension

Validation

  • ran node --check src/content/content-script.js

Why this fixes the bug

The service worker already avoids API calls when disabled, but the content script was showing the loading overlay before that check. This moves the disabled-state gate into the content script so the overlay never appears in the first place.

@Shantanugupta43
Copy link
Copy Markdown
Owner

Hey thanks for your contributions I will have a look and would review after 3 days. Cheers :)

Copy link
Copy Markdown
Owner

@Shantanugupta43 Shantanugupta43 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I will merge it now.

@Shantanugupta43 Shantanugupta43 merged commit b360596 into Shantanugupta43:main Mar 31, 2026
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.

When extension is disabled, extension still shows "thinking" message but no api is called.

2 participants