mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 15:00:30 +03:00
Hide bookmark entries for featured servers
This commit is contained in:
parent
be51dc5f12
commit
2f42ca99fc
2 changed files with 85 additions and 84 deletions
|
|
@ -7,16 +7,17 @@ export type InCinnyExploreServersContent = {
|
|||
servers?: string[];
|
||||
};
|
||||
|
||||
export const useExploreServers = (): [
|
||||
string[],
|
||||
(server: string) => Promise<void>,
|
||||
(server: string) => Promise<void>
|
||||
] => {
|
||||
export const useExploreServers = (
|
||||
exclude?: string[]
|
||||
): [string[], (server: string) => Promise<void>, (server: string) => Promise<void>] => {
|
||||
const mx = useMatrixClient();
|
||||
const accountData = useAccountData(AccountDataEvent.CinnyExplore);
|
||||
const userAddedServers = useMemo(
|
||||
() => accountData?.getContent<InCinnyExploreServersContent>()?.servers ?? [],
|
||||
[accountData]
|
||||
() =>
|
||||
accountData
|
||||
?.getContent<InCinnyExploreServersContent>()
|
||||
?.servers?.filter((server) => !exclude?.includes(server)) ?? [],
|
||||
[exclude, accountData]
|
||||
);
|
||||
|
||||
const addServer = useCallback(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue