diff --git a/src/app/slices/mainSlice.ts b/src/app/slices/mainSlice.ts index c7299e649..98fd12d6e 100644 --- a/src/app/slices/mainSlice.ts +++ b/src/app/slices/mainSlice.ts @@ -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 @@ -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; }, diff --git a/src/extension/background.js b/src/extension/background.js index 59b001c80..210950082 100644 --- a/src/extension/background.js +++ b/src/extension/background.js @@ -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