Skip to content

Commit 001ba9e

Browse files
committed
fixed index issue starting at 0 instead of 1 on empty
1 parent 165ad15 commit 001ba9e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/extension/background.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ chrome.runtime.onConnect.addListener(port => {
109109
// reassigning pointer to the appropriate node to branch off of
110110
tabsObj[tabId].currLocation = tabsObj[tabId].hierarchy;
111111
// reset index
112-
tabsObj[tabId].index = 0;
112+
tabsObj[tabId].index = 1;
113113
return;
114114
case 'setLock':
115115
tabsObj[tabId].mode.locked = payload;
@@ -161,8 +161,7 @@ chrome.runtime.onMessage.addListener((request, sender) => {
161161
if (!persist) {
162162
tabsObj[tabId].snapshots.splice(1);
163163
// reset children in root node to reset graph
164-
// if (tabsObj[tabId].hierarchy)
165-
tabsObj[tabId].hierarchy.children = [];
164+
if (tabsObj[tabId].hierarchy) tabsObj[tabId].hierarchy.children = [];
166165
// reassigning pointer to the appropriate node to branch off of
167166
tabsObj[tabId].currLocation = tabsObj[tabId].hierarchy;
168167
// reset index

0 commit comments

Comments
 (0)