Add HideServers (#36)

* Add HideServers

* HideServers: Add a count indicator and a modal to manage hidden servers

* Dont include servers youve left in the indicator count

* fix(hideServers) for webpack change

* fix(hideServers): update regex

* fix(hideServers): rewrite to use stores

* move hideServers to equicordplugins

* add serverhider to readme

* put myself in equicorddevs

* formatting nit
This commit is contained in:
bep 2024-09-05 17:02:16 -07:00 committed by GitHub
parent 0f9ef9949b
commit f2696a118f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 461 additions and 8 deletions

View file

@ -23,13 +23,17 @@ const logger = new Logger("ServerListAPI");
export const enum ServerListRenderPosition {
Above,
In,
Below,
}
const renderFunctionsAbove = new Set<Function>();
const renderFunctionsIn = new Set<Function>();
const renderFunctions = {
[ServerListRenderPosition.Above]: new Set<Function>(),
[ServerListRenderPosition.In]: new Set<Function>(),
[ServerListRenderPosition.Below]: new Set<Function>(),
};
function getRenderFunctions(position: ServerListRenderPosition) {
return position === ServerListRenderPosition.Above ? renderFunctionsAbove : renderFunctionsIn;
return renderFunctions[position];
}
export function addServerListElement(position: ServerListRenderPosition, renderFunction: Function) {