Fixes For HideServers
Some checks are pending
Release / Build Equicord (push) Waiting to run
Sync to Codeberg / Sync Codeberg and Github (push) Waiting to run
Test / Test (push) Waiting to run

This commit is contained in:
thororen1234 2025-03-13 13:41:54 -04:00
parent 5bb6148daf
commit c754e5d7b8
No known key found for this signature in database
3 changed files with 9 additions and 9 deletions

View file

@ -77,8 +77,8 @@ export default definePlugin({
find: '("guildsnav")',
replacement: [
{
match: /(?<=#{intl::SERVERS}\),children:)(\i)(\)?\.map\(\i\))/g,
replace: "$self.useFilteredGuilds($1)$2",
match: /(?<=#{intl::SERVERS}\),children:)(\i)/g,
replace: "$self.useFilteredGuilds($1)",
},
// despite my best efforts, the above doesnt trigger a rerender
{
@ -113,6 +113,7 @@ export default definePlugin({
useFilteredGuilds(guilds: guildsNode[]): guildsNode[] {
const hiddenGuilds = useStateFromStores([HiddenServersStore], () => HiddenServersStore.hiddenGuilds, undefined, (old, newer) => old.size === newer.size);
return guilds.flatMap(guild => {
if (!(hiddenGuilds instanceof Set)) return [guild];
if (hiddenGuilds.has(guild.id.toString())) {
return [];
}