You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-31 13:44:28 +03:00
Honor font settings in Element Call (#9751)
Because this encodes font settings into widget URLs at the time that the client first loads a call, this has the consequence that users may need to restart their client to see font setting changes take effect in Element Call. For users who rely on these settings for accessibility, it's a lot better than nothing, though.
This commit is contained in:
@ -596,6 +596,32 @@ describe("ElementCall", () => {
|
||||
|
||||
expect(Call.get(room)).toBeNull();
|
||||
});
|
||||
|
||||
it("passes font settings through widget URL", async () => {
|
||||
const originalGetValue = SettingsStore.getValue;
|
||||
SettingsStore.getValue = <T>(name: string, roomId?: string, excludeDefault?: boolean) => {
|
||||
switch (name) {
|
||||
case "baseFontSize":
|
||||
return 12 as T;
|
||||
case "useSystemFont":
|
||||
return true as T;
|
||||
case "systemFont":
|
||||
return "OpenDyslexic, DejaVu Sans" as T;
|
||||
default:
|
||||
return originalGetValue<T>(name, roomId, excludeDefault);
|
||||
}
|
||||
};
|
||||
|
||||
await ElementCall.create(room);
|
||||
const call = Call.get(room);
|
||||
if (!(call instanceof ElementCall)) throw new Error("Failed to create call");
|
||||
|
||||
const urlParams = new URLSearchParams(new URL(call.widget.url).hash.slice(1));
|
||||
expect(urlParams.get("fontScale")).toBe("1.2");
|
||||
expect(urlParams.getAll("font")).toEqual(["OpenDyslexic", "DejaVu Sans"]);
|
||||
|
||||
SettingsStore.getValue = originalGetValue;
|
||||
});
|
||||
});
|
||||
|
||||
describe("instance in a non-video room", () => {
|
||||
|
Reference in New Issue
Block a user