mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-02 12:07:34 +00:00
Show user status in timeline (#32991)
* Use other branch * All the changes that got lost * Fix merge * Ensure emoji can only be one character long * Fixup labs feature * Remove redundant check * Update snapshot * update snapshot * add snapshot * unpin * fix pnpm lock * undo pn[m lockfile changes altogether as we shouldn't actually need any afaik * update snpahot for changed IDs * Snapshot update * Snapshot update * There is now another section * more snapshots * more snapshot * More snapshots * oh come on snapshots * actual snapshot update * Fix sonar issues * just update the thing manually * [screams internally] * Update snapshot * test for useUserStatus * Make useUserStatus actually truncate * Split out slash command to its own file & add test * Remove irrelevant comment * doc * Comment on non-obvious error message --------- Co-authored-by: David Baker <dbkr@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
Copyright 2026 Element Creations Ltd.
|
||||
Copyright 2024 New Vector Ltd.
|
||||
Copyright 2023 The Matrix.org Foundation C.I.C.
|
||||
|
||||
@@ -12,6 +13,7 @@ import { type WatchManager } from "../WatchManager";
|
||||
import SettingsStore from "../SettingsStore";
|
||||
import { type SettingKey } from "../Settings.tsx";
|
||||
import { _t } from "../../languageHandler.tsx";
|
||||
import PlatformPeg from "../../PlatformPeg.ts";
|
||||
|
||||
/**
|
||||
* Disables a given setting if the server unstable feature it requires is not supported
|
||||
@@ -28,6 +30,9 @@ export default class ServerSupportUnstableFeatureController extends MatrixClient
|
||||
* @param unstableFeatureGroups - If any one of the feature groups is satisfied,
|
||||
* then the setting is considered enabled. A feature group is satisfied if all of
|
||||
* the features in the group are supported (all features in a group are required).
|
||||
* @param defaultEnabled - If we haven't been able to check for support yet, should
|
||||
* this feature be enabled or disabled (default).
|
||||
* @param forceReload - Should the client force reload.
|
||||
*/
|
||||
public constructor(
|
||||
private readonly settingName: SettingKey,
|
||||
@@ -36,12 +41,23 @@ export default class ServerSupportUnstableFeatureController extends MatrixClient
|
||||
private readonly stableVersion?: string,
|
||||
private readonly disabledMessage?: TranslationKey,
|
||||
private readonly forcedValue: any = false,
|
||||
private readonly defaultEnabled = false,
|
||||
private readonly forceReload = false,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
public onChange(): void {
|
||||
if (this.forceReload) {
|
||||
PlatformPeg.get()?.reload();
|
||||
}
|
||||
}
|
||||
|
||||
public get disabled(): boolean {
|
||||
return !this.enabled;
|
||||
if (this.enabled !== undefined) {
|
||||
return !this.enabled;
|
||||
}
|
||||
return !this.defaultEnabled;
|
||||
}
|
||||
|
||||
public set disabled(newDisabledValue: boolean) {
|
||||
|
||||
Reference in New Issue
Block a user