Files
ThreadNet-Web/src/settings/controllers/SystemFontController.ts
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
1.1 KiB
TypeScript
Raw Normal View History

2020-04-14 16:18:57 +01:00
/*
2024-09-09 14:57:16 +01:00
Copyright 2024 New Vector Ltd.
2020-04-14 16:18:57 +01:00
Copyright 2020 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
2024-09-09 14:57:16 +01:00
Please see LICENSE files in the repository root for full details.
2020-04-14 16:18:57 +01:00
*/
import SettingController from "./SettingController";
2020-06-15 15:33:52 +01:00
import SettingsStore from "../SettingsStore";
2020-05-20 14:44:56 +01:00
import dis from "../../dispatcher/dispatcher";
2020-06-15 15:33:52 +01:00
import { UpdateSystemFontPayload } from "../../dispatcher/payloads/UpdateSystemFontPayload";
import { Action } from "../../dispatcher/actions";
2020-04-14 16:18:57 +01:00
2020-06-15 15:33:52 +01:00
export default class SystemFontController extends SettingController {
public constructor() {
2020-04-16 11:56:43 +01:00
super();
2020-04-14 16:18:57 +01:00
}
2023-11-23 13:04:05 +00:00
public onChange(): void {
2020-04-14 16:18:57 +01:00
// Dispatch font size change so that everything open responds to the change.
2020-06-15 15:33:52 +01:00
dis.dispatch<UpdateSystemFontPayload>({
action: Action.UpdateSystemFont,
2023-11-23 13:04:05 +00:00
useBundledEmojiFont: SettingsStore.getValue("useBundledEmojiFont"),
2020-06-15 15:33:52 +01:00
useSystemFont: SettingsStore.getValue("useSystemFont"),
2023-11-23 13:04:05 +00:00
font: SettingsStore.getValue("systemFont"),
2020-04-14 16:18:57 +01:00
});
}
}