diff --git a/src/app/features/settings/about/About.tsx b/src/app/features/settings/about/About.tsx index 54d81ec93..0ecf98452 100644 --- a/src/app/features/settings/about/About.tsx +++ b/src/app/features/settings/about/About.tsx @@ -42,9 +42,16 @@ function useServerSupport(): { support: MSC1929Support | null; loading: boolean useEffect(() => { const controller = new AbortController(); - const baseUrl = mx.getHomeserverUrl(); + // MSC1929 support info is served from the MXID server-name host (like + // /.well-known/matrix/client), which on delegated/split-domain servers is + // NOT the client-API URL. Derive it from the user's domain. + const serverName = mx.getDomain(); + if (!serverName) { + setLoading(false); + return undefined; + } setLoading(true); - fetch(`${baseUrl}/.well-known/matrix/support`, { signal: controller.signal }) + fetch(`https://${serverName}/.well-known/matrix/support`, { signal: controller.signal }) .then((res) => { if (!res.ok) return null; return res.json(); diff --git a/src/app/features/settings/notifications/PushRuleEditor.tsx b/src/app/features/settings/notifications/PushRuleEditor.tsx index df57676db..68291526c 100644 --- a/src/app/features/settings/notifications/PushRuleEditor.tsx +++ b/src/app/features/settings/notifications/PushRuleEditor.tsx @@ -1,4 +1,11 @@ -import React, { ChangeEventHandler, FormEventHandler, useCallback, useMemo, useState } from 'react'; +import React, { + ChangeEventHandler, + FormEventHandler, + useCallback, + useEffect, + useMemo, + useState, +} from 'react'; import { IPushRule, IPushRules, PushRuleKind } from 'matrix-js-sdk'; import { Box, Text, Button, Input, config, IconButton, Icons, Icon, Spinner, Switch } from 'folds'; import { SettingsSelect } from '../../../components/settings-select/SettingsSelect'; @@ -56,6 +63,13 @@ function RuleEnableToggle({ kind, pushRule }: RuleEnableToggleProps) { const mx = useMatrixClient(); const [enabled, setEnabled] = useState(pushRule.enabled !== false); + // Re-sync when the rule changes externally (e.g. toggled on another device → + // account-data sync). The useState initializer only runs once, so without + // this the Switch would show a stale value. + useEffect(() => { + setEnabled(pushRule.enabled !== false); + }, [pushRule.enabled]); + const [toggleState, toggle] = useAsyncCallback( useCallback( async (value: boolean) => {