Skip to content

Commit

Permalink
Merge pull request #336 from open-source-labs/oliver/cleanup
Browse files Browse the repository at this point in the history
Oliver/cleanup clear button bug fix
  • Loading branch information
ay7991 authored Feb 27, 2024
2 parents fa44f3b + 78dd524 commit c128ed3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
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

0 comments on commit c128ed3

Please sign in to comment.