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

View file

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

View file

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

View file

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