You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-05 23:10:41 +03:00
Fix calculatedAtLevel definition
This commit is contained in:
@@ -402,7 +402,7 @@ export default class SettingsStore {
|
|||||||
level: SettingLevel,
|
level: SettingLevel,
|
||||||
roomId: string,
|
roomId: string,
|
||||||
calculatedValue: any,
|
calculatedValue: any,
|
||||||
calculatedAtLevel: any,
|
calculatedAtLevel: SettingLevel,
|
||||||
): any {
|
): any {
|
||||||
let resultingValue = calculatedValue;
|
let resultingValue = calculatedValue;
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,12 @@ function getNotifier(): any { // TODO: [TS] Formal type that doesn't cause a cyc
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class NotificationsEnabledController extends SettingController {
|
export class NotificationsEnabledController extends SettingController {
|
||||||
public getValueOverride(level: SettingLevel, roomId: string, calculatedValue: any, calculatedAtLevel: any): any {
|
public getValueOverride(
|
||||||
|
level: SettingLevel,
|
||||||
|
roomId: string,
|
||||||
|
calculatedValue: any,
|
||||||
|
calculatedAtLevel: SettingLevel,
|
||||||
|
): any {
|
||||||
if (!getNotifier().isPossible()) return false;
|
if (!getNotifier().isPossible()) return false;
|
||||||
|
|
||||||
if (calculatedValue === null || calculatedAtLevel === "default") {
|
if (calculatedValue === null || calculatedAtLevel === "default") {
|
||||||
|
|||||||
@@ -33,11 +33,16 @@ export default abstract class SettingController {
|
|||||||
* @param {String} roomId The room ID, may be null.
|
* @param {String} roomId The room ID, may be null.
|
||||||
* @param {*} calculatedValue The value that the handlers think the setting should be,
|
* @param {*} calculatedValue The value that the handlers think the setting should be,
|
||||||
* may be null.
|
* may be null.
|
||||||
* @param {string} calculatedAtLevel The level for which the calculated value was
|
* @param {SettingLevel} calculatedAtLevel The level for which the calculated value was
|
||||||
* calculated at. May be null.
|
* calculated at. May be null.
|
||||||
* @return {*} The value that should be used, or null if no override is applicable.
|
* @return {*} The value that should be used, or null if no override is applicable.
|
||||||
*/
|
*/
|
||||||
public getValueOverride(level: SettingLevel, roomId: string, calculatedValue: any, calculatedAtLevel: any): any {
|
public getValueOverride(
|
||||||
|
level: SettingLevel,
|
||||||
|
roomId: string,
|
||||||
|
calculatedValue: any,
|
||||||
|
calculatedAtLevel: SettingLevel,
|
||||||
|
): any {
|
||||||
return null; // no override
|
return null; // no override
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,12 @@ import { SettingLevel } from "../SettingLevel";
|
|||||||
export default class ThemeController extends SettingController {
|
export default class ThemeController extends SettingController {
|
||||||
public static isLogin = false;
|
public static isLogin = false;
|
||||||
|
|
||||||
public getValueOverride(level: SettingLevel, roomId: string, calculatedValue: any, calculatedAtLevel: any): any {
|
public getValueOverride(
|
||||||
|
level: SettingLevel,
|
||||||
|
roomId: string,
|
||||||
|
calculatedValue: any,
|
||||||
|
calculatedAtLevel: SettingLevel,
|
||||||
|
): any {
|
||||||
if (!calculatedValue) return null; // Don't override null themes
|
if (!calculatedValue) return null; // Don't override null themes
|
||||||
|
|
||||||
if (ThemeController.isLogin) return 'light';
|
if (ThemeController.isLogin) return 'light';
|
||||||
|
|||||||
Reference in New Issue
Block a user