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

Fix Storage Sync Checkbox Initialization on Page Load #353

Closed
wants to merge 1 commit into from

Conversation

maximedrouhin
Copy link

Description

This pull request addresses a small issue with the initialization of the storage sync checkbox in the redirectorpage.js file. Previously, the checkbox would always appear unchecked upon page load, regardless of the actual sync status. With this fix, the checkbox now properly reflects the sync status on page load.

Changes

The primary change made in this pull request is to correctly set the checked property of the input element for the storage sync checkbox during the initial load. The modified code snippet is as follows:

chrome.storage.local.get({isSyncEnabled:false}, function(obj){
	options.isSyncEnabled = obj.isSyncEnabled;
	el('#storage-sync-option input').checked = options.isSyncEnabled;
});

The issue was caused by setting the checked property on the label element instead of the input element. The updated code selects the correct input element and sets its checked property based on the isSyncEnabled value.

Impact

This change ensures a better user experience, as the storage sync checkbox will now correctly display its status upon loading the page. This helps users understand the current sync setting and reduces confusion when using the extension.

Testing

To verify the changes, follow these steps:

  1. Load the extension with the updated code.
  2. Check the storage sync checkbox and refresh the page to ensure the checkbox remains checked.
  3. Uncheck the storage sync checkbox and refresh the page to ensure the checkbox remains unchecked.
  4. Toggle the storage sync checkbox multiple times and refresh the page to confirm that the checkbox's state is always consistent with the sync status.

Please let me know if you have any questions or need any further clarification. I'm looking forward to hearing your thoughts on this fix, and I hope it improves the extension's user experience!

This commit resolves the issue where the storage sync checkbox would always appear unchecked on page load, regardless of its actual sync status. The fix ensures that the checkbox properly reflects the sync status during the initial load by setting the `checked` property of the input element correctly. This improves the user experience by providing accurate sync status information.
@maximedrouhin
Copy link
Author

Closed this as it is a duplicate of #305, which proposes the exact same change in the code to fix the Sync Checkbox Initialization issue.

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