We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 627b805 commit 1b21944Copy full SHA for 1b21944
src/utils/api/activedTabsHistory.js
@@ -1,14 +1,20 @@
1
const HistoryActiveTabs = function () {
2
this.tabsId = [];
3
};
4
-HistoryActiveTabs.prototype.getTab = function () {
+HistoryActiveTabs.prototype.popLastTabID = function () {
5
return this.tabsId.pop();
6
7
HistoryActiveTabs.prototype.reset = function () {
8
9
10
HistoryActiveTabs.prototype.add = function (id) {
11
- const tabsId = this.tabsId;
12
- tabsId[tabsId.length - 1] === id || tabsId.push(id);
+ this.tabsId.push(id);
+};
13
+HistoryActiveTabs.prototype.remove = function (id) {
14
+ const tabIDs = this.tabsId;
15
+ while (tabIDs.indexOf(id) >= 0) {
16
+ tabIDs.splice(tabIDs.indexOf(id), 1);
17
+ }
18
+ return this;
19
20
export default HistoryActiveTabs;
0 commit comments