Skip to content

Commit c128ed3

Browse files
authored
Merge pull request #336 from open-source-labs/oliver/cleanup
Oliver/cleanup clear button bug fix
2 parents fa44f3b + 78dd524 commit c128ed3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/app/slices/mainSlice.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@ export const mainSlice = createSlice({
4848
tabs[currentTab].playing = false;
4949

5050
const currSnapshot = tabs[currentTab].snapshots[tabs[currentTab].currLocation.index]; // current snapshot
51-
const currAxSnapshot = tabs[currentTab].axSnapshots[tabs[currentTab].currLocation.index]; // current snapshot
51+
const currAxSnapshot = tabs[currentTab].axSnapshots[tabs[currentTab].currLocation.index]; // current accessibility tree snapshot
5252

53-
tabs[currentTab].hierarchy.stateSnapshot = { ...currSnapshot }; // resets hierarchy to page current snapshot
54-
// not sure why shallow deep copy
55-
tabs[currentTab].hierarchy.axSnapshot = currAxSnapshot; // resets hierarchy to current snapshot
53+
tabs[currentTab].hierarchy.stateSnapshot = { ...currSnapshot }; // resets hierarchy to current snapshot
54+
tabs[currentTab].hierarchy.axSnapshot = { ...currAxSnapshot }; // resets hierarchy to current accessibility tree snapshot
5655
tabs[currentTab].hierarchy.children = []; // resets hierarchy
5756
tabs[currentTab].snapshots = [currSnapshot]; // resets snapshots to current snapshot
5857
tabs[currentTab].axSnapshots = [currAxSnapshot]; // resets snapshots to current snapshot
@@ -61,6 +60,7 @@ export const mainSlice = createSlice({
6160
tabs[currentTab].index = 1;
6261
tabs[currentTab].currParent = 0;
6362
tabs[currentTab].currBranch = 1;
63+
tabs[currentTab].currLocation = tabs[currentTab].hierarchy; // reset currLocation
6464
tabs[currentTab].seriesSavedStatus = false;
6565
},
6666

src/extension/background.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,11 @@ chrome.runtime.onConnect.addListener((port) => {
368368
tabsObj[tabId].axSnapshots = [
369369
tabsObj[tabId].axSnapshots[tabsObj[tabId].currLocation.index],
370370
]; // resets axSnapshots to current page state
371-
tabsObj[tabId].hierarchy.axSnapshot = tabsObj[tabId].axSnapshots[0]; // resets hierarchy to ax tree of current page state
371+
tabsObj[tabId].hierarchy.axSnapshot = tabsObj[tabId].axSnapshots[0]; // resets hierarchy to accessibility tree of current page state
372372
tabsObj[tabId].index = 1; //reset index
373373
tabsObj[tabId].currParent = 0; // reset currParent
374374
tabsObj[tabId].currBranch = 1; // reset currBranch
375+
tabsObj[tabId].currLocation = tabsObj[tabId].hierarchy; // reset currLocation
375376

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

0 commit comments

Comments
 (0)