Files
ThreadNet-Web/apps/web/src/settings/controllers/FontSizeController.ts
T

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

30 lines
1.0 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-05-20 14:44:56 +01:00
import dis from "../../dispatcher/dispatcher";
2025-02-05 13:25:06 +00:00
import { type UpdateFontSizeDeltaPayload } from "../../dispatcher/payloads/UpdateFontSizeDeltaPayload";
2020-06-15 15:33:52 +01:00
import { Action } from "../../dispatcher/actions";
2026-07-15 11:21:49 +01:00
import { type SettingLevel } from "../SettingLevel";
2020-04-14 16:18:57 +01:00
export default class FontSizeController extends SettingController {
public constructor() {
2020-04-16 11:56:43 +01:00
super();
2020-04-14 16:18:57 +01:00
}
public onChange(level: SettingLevel, roomId: string, newValue: any): void {
2026-07-15 11:21:49 +01:00
if (newValue !== "") {
2023-06-29 11:30:25 +01:00
// Dispatch font size change so that everything open responds to the change.
dis.dispatch<UpdateFontSizeDeltaPayload>({
action: Action.UpdateFontSizeDelta,
delta: newValue,
2023-06-29 11:30:25 +01:00
});
}
2020-04-14 16:18:57 +01:00
}
}