Skip to content

Commit

Permalink
Simplify/fix is open check
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski committed Nov 5, 2023
1 parent c106f0a commit 753afa4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions galata/src/helpers/activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,11 @@ export class ActivityHelper {
return activeTab === name;
} else {
const tab = await this.getTab(name);
return (
(tab &&
(await tab.evaluate((tab: Element) =>
tab.classList.contains('jp-mod-current')
))) ??
false
);
if (!tab) {
return false;
}
const classes = ((await tab.getAttribute('class')) ?? '').split(' ');
return classes.includes('jp-mod-current');
}
}

Expand Down

0 comments on commit 753afa4

Please sign in to comment.