This commit is contained in:
Younes Aassila 2025-02-01 13:34:52 +01:00
parent 3536898e23
commit 2ce563b271
No known key found for this signature in database
3 changed files with 15 additions and 18 deletions

View File

@ -4,8 +4,7 @@ export default function isChannelWhitelisted(
channelName: string | null
): boolean {
if (!channelName) return false;
const whitelistedChannelsLower = store.state.whitelistedChannels.map(
channel => channel.toLowerCase()
return store.state.whitelistedChannels.some(
c => c.toLowerCase() === channelName.toLowerCase()
);
return whitelistedChannelsLower.includes(channelName.toLowerCase());
}

View File

@ -4,9 +4,7 @@ export default function wasChannelSubscriber(
channelName: string | null
): boolean {
if (!channelName) return false;
const activeChannelSubscriptionsLower =
store.state.activeChannelSubscriptions.map(channel =>
channel.toLowerCase()
);
return activeChannelSubscriptionsLower.includes(channelName.toLowerCase());
return store.state.activeChannelSubscriptions.some(
c => c.toLowerCase() === channelName.toLowerCase()
);
}

View File

@ -651,11 +651,11 @@ function isChannelWhitelisted(
pageState: PageState
): boolean {
if (!channelName) return false;
const whitelistedChannelsLower =
pageState.state?.whitelistedChannels.map(channel =>
channel.toLowerCase()
) ?? [];
return whitelistedChannelsLower.includes(channelName.toLowerCase());
return (
pageState.state?.whitelistedChannels.some(
c => c.toLowerCase() === channelName.toLowerCase()
) ?? false
);
}
function wasChannelSubscriber(
@ -663,11 +663,11 @@ function wasChannelSubscriber(
pageState: PageState
): boolean {
if (!channelName) return false;
const activeChannelSubscriptionsLower =
pageState.state?.activeChannelSubscriptions.map(channel =>
channel.toLowerCase()
) ?? [];
return activeChannelSubscriptionsLower.includes(channelName.toLowerCase());
return (
pageState.state?.activeChannelSubscriptions.some(
c => c.toLowerCase() === channelName.toLowerCase()
) ?? false
);
}
async function flagRequest(