mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-11 23:53:03 -04:00
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:
parent
0f9ef9949b
commit
f2696a118f
10 changed files with 461 additions and 8 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue