Fix/issues 2 persist problem solved #5
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, the popup relied on messaging the content script to retrieve the current problem’s status, which only worked if the active tab was a LeetCode problem page and the content script had already run.
After closing and reopening the browser, or if the content script hadn’t executed yet, the popup would fail to find the problem in storage, causing solved problems to appear as unsolved and recent problems to disappear from the popup.
This change updates the popup logic to always read problem data directly from browser.storage.local, which is persistent across browser restarts. Now, the popup first checks storage for the problem’s status and only falls back to messaging the content script if the problem isn’t found. As a result, the recent problems list and solved status are correctly displayed in the popup even after restarting the browser, ensuring consistency with the data shown in the options page.
Fixes #2 👍