@setoelkahfi / svara / commits / 4b0607e

fix: js reverse is dumb

copy reversed array so it is not altered

mellbacon committed Jun 27, 2023 at 13:00 UTC 4b0607eac7eba68208d8789d476f5688bdc44551
1 file changed +2 -1
src/lib/Tab/Tab.ts
+2 -1
@@ -134,7 +134,8 @@ export class Tab {
134 }
135 async closeAllTabs() {
136 await this.closeTab(this.activeid);
137 - for (const tab of this.tablist.reverse()) {
137 + const temp = [...this.tablist].reverse(); // js just loves to be inconsistent with its array functions innit
138 + for (const tab of temp) {
139 await this.closeTab(tab.id);
140 }
141 }