Skip to content

Oliver/cleanup clear button bug fix #336

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

Merged
merged 5 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/app/slices/mainSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ export const mainSlice = createSlice({
tabs[currentTab].playing = false;

const currSnapshot = tabs[currentTab].snapshots[tabs[currentTab].currLocation.index]; // current snapshot
const currAxSnapshot = tabs[currentTab].axSnapshots[tabs[currentTab].currLocation.index]; // current snapshot
const currAxSnapshot = tabs[currentTab].axSnapshots[tabs[currentTab].currLocation.index]; // current accessibility tree snapshot

tabs[currentTab].hierarchy.stateSnapshot = { ...currSnapshot }; // resets hierarchy to page current snapshot
// not sure why shallow deep copy
tabs[currentTab].hierarchy.axSnapshot = currAxSnapshot; // resets hierarchy to current snapshot
tabs[currentTab].hierarchy.stateSnapshot = { ...currSnapshot }; // resets hierarchy to current snapshot
tabs[currentTab].hierarchy.axSnapshot = { ...currAxSnapshot }; // resets hierarchy to current accessibility tree snapshot
tabs[currentTab].hierarchy.children = []; // resets hierarchy
tabs[currentTab].snapshots = [currSnapshot]; // resets snapshots to current snapshot
tabs[currentTab].axSnapshots = [currAxSnapshot]; // resets snapshots to current snapshot
Expand All @@ -61,6 +60,7 @@ export const mainSlice = createSlice({
tabs[currentTab].index = 1;
tabs[currentTab].currParent = 0;
tabs[currentTab].currBranch = 1;
tabs[currentTab].currLocation = tabs[currentTab].hierarchy; // reset currLocation
tabs[currentTab].seriesSavedStatus = false;
},

Expand Down
3 changes: 2 additions & 1 deletion src/extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,11 @@ chrome.runtime.onConnect.addListener((port) => {
tabsObj[tabId].axSnapshots = [
tabsObj[tabId].axSnapshots[tabsObj[tabId].currLocation.index],
]; // resets axSnapshots to current page state
tabsObj[tabId].hierarchy.axSnapshot = tabsObj[tabId].axSnapshots[0]; // resets hierarchy to ax tree of current page state
tabsObj[tabId].hierarchy.axSnapshot = tabsObj[tabId].axSnapshots[0]; // resets hierarchy to accessibility tree of current page state
tabsObj[tabId].index = 1; //reset index
tabsObj[tabId].currParent = 0; // reset currParent
tabsObj[tabId].currBranch = 1; // reset currBranch
tabsObj[tabId].currLocation = tabsObj[tabId].hierarchy; // reset currLocation

return true; // return true so that port remains open

Expand Down