From 7d0bb445689054648ee3d3358b64c33ba45e934b Mon Sep 17 00:00:00 2001 From: dvelo Date: Tue, 29 Apr 2025 19:03:31 -0500 Subject: [PATCH] fix: add opposites CORRECTLY. --- apps/www/src/config/sl-mod-db.ts | 2 +- apps/www/src/lib/types/filters/tag-filter.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/www/src/config/sl-mod-db.ts b/apps/www/src/config/sl-mod-db.ts index 6415626..2e03731 100644 --- a/apps/www/src/config/sl-mod-db.ts +++ b/apps/www/src/config/sl-mod-db.ts @@ -89,7 +89,7 @@ export const serverModDB: ModDBCategory[] = [ name: "Always Online", description: "All servers that are always online.", color: "#a380e0", - value: new TagFilter(2), + value: new TagFilter(2, false), icon: ServerCog } ] diff --git a/apps/www/src/lib/types/filters/tag-filter.ts b/apps/www/src/lib/types/filters/tag-filter.ts index 602366e..ae6a73b 100644 --- a/apps/www/src/lib/types/filters/tag-filter.ts +++ b/apps/www/src/lib/types/filters/tag-filter.ts @@ -81,8 +81,10 @@ export class TagFilter implements Filter { )); if (typeof result === "boolean") - return new Promise((r) => r(!result)) + return new Promise((r) => r(this.opposite ? !result : result)) - return result; + return new Promise((r) => { + result.then((c) => r(this.opposite ? !c : c)) + }); } }