diff --git a/config.json b/config.json index ed1bca6b..196fb119 100644 --- a/config.json +++ b/config.json @@ -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, diff --git a/src/app/hooks/useClientConfig.test.ts b/src/app/hooks/useClientConfig.test.ts new file mode 100644 index 00000000..a2004d2f --- /dev/null +++ b/src/app/hooks/useClientConfig.test.ts @@ -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'); + }); +}); diff --git a/src/app/hooks/useClientConfig.ts b/src/app/hooks/useClientConfig.ts index bcf1c475..4e09905d 100644 --- a/src/app/hooks/useClientConfig.ts +++ b/src/app/hooks/useClientConfig.ts @@ -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;