Skip to content

Conversation

kaovilai
Copy link

@kaovilai kaovilai commented May 1, 2025

…etting state

I've made the necessary changes to ensure that the checkbox on the redirector page correctly reflects the current sync setting state. Here's what I've done:

First, I improved the toggleSyncSetting() function in redirectorpage.js to use the actual checkbox state when enabling or disabling sync, rather than always toggling the current setting.

Next, I enhanced the page load process in redirectorpage.js to fetch the sync state directly from the background page using a new message type get-sync-state. This ensures that the checkbox always reflects the true state of the sync setting when the page loads.

Finally, I added a message handler for the new get-sync-state message type in background.js to respond with the current sync state, making the system work properly.

This implementation now:

Correctly sets the checkbox state on page load based on the current sync setting Uses the checkbox state to properly enable or disable sync when the checkbox is clicked Ensures the checkbox state always reflects the actual sync setting, even after errors occur

…etting state

I've made the necessary changes to ensure that the checkbox on the redirector page correctly reflects the current sync setting state. Here's what I've done:

First, I improved the toggleSyncSetting() function in redirectorpage.js to use the actual checkbox state when enabling or disabling sync, rather than always toggling the current setting.

Next, I enhanced the page load process in redirectorpage.js to fetch the sync state directly from the background page using a new message type get-sync-state. This ensures that the checkbox always reflects the true state of the sync setting when the page loads.

Finally, I added a message handler for the new get-sync-state message type in background.js to respond with the current sync state, making the system work properly.

This implementation now:

Correctly sets the checkbox state on page load based on the current sync setting
Uses the checkbox state to properly enable or disable sync when the checkbox is clicked
Ensures the checkbox state always reflects the actual sync setting, even after errors occur

Signed-off-by: Tiger Kaovilai <[email protected]>
Copy link
Collaborator

@Gitoffthelawn Gitoffthelawn left a comment

Choose a reason for hiding this comment

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

Thank you!

What's the purpose of the fallback? When will that come into play?

@kaovilai
Copy link
Author

kaovilai commented May 2, 2025

Idk. I guess it doesn't hurt

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.

2 participants