Skip to content

Conversation

@ThomasK33
Copy link
Member

Summary

  • Fix GatewayIcon not forwarding refs (React warning about function components and refs)
  • Make gateway icon clickable on main page to toggle gateway routing
  • Remove redundant updatePersistedState calls that caused double-toggle bug

Root cause

setEnabledModels() from usePersistedState already writes to localStorage synchronously, but updatePersistedState() was also being called. This read the already-toggled value from localStorage and toggled it again, effectively reverting the change.

Test plan

  • Click gateway icon next to model selector - should toggle on/off
  • Toggle in settings Models section - should persist
  • No more React warning about refs on GatewayIcon

Generated with Claude Code

- Fix GatewayIcon not forwarding refs (React warning)
- Make gateway icon clickable on main page to toggle gateway
- Remove redundant updatePersistedState calls that caused double-toggle

The bug: setEnabledModels() from usePersistedState already writes to
localStorage synchronously, but updatePersistedState() was also called,
reading the already-toggled value and toggling again, reverting changes.
@ThomasK33
Copy link
Member Author

Already fixed by #1112

@ThomasK33 ThomasK33 closed this Dec 12, 2025
@ThomasK33 ThomasK33 deleted the fix-gateway-toggle branch December 12, 2025 10:44
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.

1 participant