mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-02-22 21:23:09 +01:00
move featured servers config from homeserver list
This commit is contained in:
parent
4fb8e83574
commit
200e531a3c
3 changed files with 6 additions and 4 deletions
|
@ -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": {
|
||||||
|
|
|
@ -9,6 +9,7 @@ export type ClientConfig = {
|
||||||
openAsDefault?: boolean;
|
openAsDefault?: boolean;
|
||||||
spaces?: string[];
|
spaces?: string[];
|
||||||
rooms?: string[];
|
rooms?: string[];
|
||||||
|
servers?: string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
hashRouter?: {
|
hashRouter?: {
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue