Skip to content

Commit

Permalink
fix: fix system now properly deletes tabs when checking on load
Browse files Browse the repository at this point in the history
  • Loading branch information
Tormak9970 committed Jan 20, 2024
1 parent 6f34c19 commit c03862f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/lib/controllers/TabErrorController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ export class TabErrorController {
onConfirm={(editedTabSettings: TabSettingsDictionary) => {
for (const tab of Object.values(editedTabSettings)) {
if (tabsToFix.has(tab.id)) {
if (tab.filters!.length === 0) tabMasterManager.deleteTab(tab.id);
else tabMasterManager.updateCustomTab(tab.id, tab as EditableTabSettings);
if (tab.filters!.length === 0) {
tabMasterManager.deleteTab(tab.id);
} else {
tabMasterManager.updateCustomTab(tab.id, tab as EditableTabSettings);
}
}
}

Expand All @@ -70,8 +73,11 @@ export class TabErrorController {
*/
private static processQueue = (tabMasterManager: TabMasterManager) => {
const validationSet = this.validationQueue.splice(0, this.validationQueue.length);
if (validationSet.length > 0) this.validateInternal(validationSet, tabMasterManager);
else this.validationLock = false;
if (validationSet.length > 0) {
this.validateInternal(validationSet, tabMasterManager);
} else {
this.validationLock = false;
}
}

/**
Expand Down Expand Up @@ -131,7 +137,7 @@ export class TabErrorController {
onConfirm={(editedTabSettings: TabSettingsDictionary) => {
const tabsToDelete: string[] = [];
for (const tab of Object.values(editedTabSettings)) {
if (tabsToFix.has(tab.id) && tab.filters!.length === 0) tabsToDelete.push();
if (tabsToFix.has(tab.id) && tab.filters!.length === 0) tabsToDelete.push(tab.id);
}

finishLoading(editedTabSettings);
Expand Down

0 comments on commit c03862f

Please sign in to comment.