Compare commits

...
Sign in to create a new pull request.
Author SHA1 Message Date
Void
d998978692 config: gamecult.org is the default homeserver
All checks were successful
Build pull request / Build pull request (pull_request) Successful in 3m32s
clientDefaultServer falls back to gamecult.org instead of matrix.org, and the repo config.json lists it first and defaults to it. A config that names its own list (the production pin) is unaffected. A test pins the fallback and the repo config.
2026-11-11 00:25:42 +00:00
3 changed files with 30 additions and 3 deletions

View file

@ -1,6 +1,13 @@
{
"defaultHomeserver": 1,
"homeserverList": ["converser.eu", "matrix.org", "mozilla.org", "unredacted.org", "xmr.se"],
"defaultHomeserver": 0,
"homeserverList": [
"gamecult.org",
"converser.eu",
"matrix.org",
"mozilla.org",
"unredacted.org",
"xmr.se"
],
"allowCustomHomeservers": true,
"featuredCommunities": {
"openAsDefault": false,

View file

@ -0,0 +1,20 @@
import { describe, expect, it } from 'vitest';
import { clientDefaultServer } from './useClientConfig';
import config from '../../../config.json';
describe('default homeserver', () => {
it('is gamecult.org when the config names none', () => {
expect(clientDefaultServer({})).toBe('gamecult.org');
expect(clientDefaultServer({ homeserverList: [] })).toBe('gamecult.org');
});
it('is the listed server the config points at', () => {
expect(
clientDefaultServer({ homeserverList: ['chat.gamecult.org'], defaultHomeserver: 0 })
).toBe('chat.gamecult.org');
});
it('is gamecult.org in the repo config.json too', () => {
expect(clientDefaultServer(config)).toBe('gamecult.org');
});
});

View file

@ -44,7 +44,7 @@ export function useClientConfig(): ClientConfig {
}
export const clientDefaultServer = (clientConfig: ClientConfig): string =>
clientConfig.homeserverList?.[clientConfig.defaultHomeserver ?? 0] ?? 'matrix.org';
clientConfig.homeserverList?.[clientConfig.defaultHomeserver ?? 0] ?? 'gamecult.org';
export const clientAllowedServer = (clientConfig: ClientConfig, server: string): boolean => {
const { homeserverList, allowCustomHomeservers } = clientConfig;