move featured servers config from homeserver list

This commit is contained in:
Ajay Bura 2024-05-16 16:14:55 +05:30
parent 4fb8e83574
commit 200e531a3c
3 changed files with 6 additions and 4 deletions
config.json
src/app
hooks
pages/client/explore

View file

@ -26,7 +26,8 @@
"#thisweekinmatrix:matrix.org",
"#matrix-dev:matrix.org",
"#matrix:matrix.org"
]
],
"servers": ["envs.net", "matrix.org", "monero.social", "mozilla.org"]
},
"hashRouter": {

View file

@ -9,6 +9,7 @@ export type ClientConfig = {
openAsDefault?: boolean;
spaces?: string[];
rooms?: string[];
servers?: string[];
};
hashRouter?: {

View file

@ -30,7 +30,7 @@ import {
NavLink,
} from '../../../components/nav';
import { getExploreFeaturedPath, getExploreServerPath } from '../../pathUtils';
import { clientDefaultServer, useClientConfig } from '../../../hooks/useClientConfig';
import { useClientConfig } from '../../../hooks/useClientConfig';
import {
useExploreFeaturedSelected,
useExploreServer,
@ -162,8 +162,8 @@ export function Explore() {
const userId = mx.getUserId();
const clientConfig = useClientConfig();
const userServer = userId ? getMxIdServer(userId) : undefined;
const clientServers = clientConfig.homeserverList ?? [clientDefaultServer(clientConfig)];
const servers = clientServers.filter((server) => server !== userServer);
const servers =
clientConfig.featuredCommunities?.servers?.filter((server) => server !== userServer) ?? [];
const featuredSelected = useExploreFeaturedSelected();
const selectedServer = useExploreServer();