c0bf2005a73af9ce5e56194ea9cb8ba8ad36db53
The toggle was still reverting because the NostrSync component was re-syncing old encrypted settings whenever the query refetched. Root cause: - When toggle is clicked, it updates config and saves to Nostr - The encrypted settings query refetches the data - NostrSync effect runs again with the refetched (old) data - This overwrites the just-updated local config Solution: - Added lastSyncedTimestamp ref to track which settings we've synced - Only sync if the remote timestamp is newer than what we've synced - Changed updateSettings call from mutateAsync to mutate (non-blocking) - This prevents re-syncing the same settings multiple times The toggle now works correctly without reverting. Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
Description
Languages
TypeScript
95.7%
Java
1.5%
JavaScript
0.9%
Swift
0.9%
CSS
0.5%
Other
0.4%