From 753afa4bfa0264568e24e04c0b1accd3f53f1a95 Mon Sep 17 00:00:00 2001 From: krassowski <5832902+krassowski@users.noreply.github.com> Date: Sun, 5 Nov 2023 15:06:55 +0000 Subject: [PATCH] Simplify/fix is open check --- galata/src/helpers/activity.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/galata/src/helpers/activity.ts b/galata/src/helpers/activity.ts index 5a5760ff8f25..b36acd2da690 100644 --- a/galata/src/helpers/activity.ts +++ b/galata/src/helpers/activity.ts @@ -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'); } }