Skip to content

Commit b55cfb2

Browse files
committed
Make themed widgets reflect the effective theme
So that widgets such as Element Call will show up in the right theme even if the app is set to match the system theme.
1 parent 386b782 commit b55cfb2

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/components/views/dialogs/ModalWidgetDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ import { OwnProfileStore } from "../../../stores/OwnProfileStore";
3232
import { arrayFastClone } from "../../../utils/arrays";
3333
import { ElementWidget } from "../../../stores/widgets/StopGapWidget";
3434
import { ELEMENT_CLIENT_ID } from "../../../identifiers";
35-
import SettingsStore from "../../../settings/SettingsStore";
3635
import WarningBadgeSvg from "../../../../res/img/element-icons/warning-badge.svg";
36+
import ThemeWatcher from "../../../settings/watchers/ThemeWatcher";
3737

3838
interface IProps {
3939
widgetDefinition: IModalWidgetOpenRequestData;
@@ -127,7 +127,7 @@ export default class ModalWidgetDialog extends React.PureComponent<IProps, IStat
127127
userDisplayName: OwnProfileStore.instance.displayName ?? undefined,
128128
userHttpAvatarUrl: OwnProfileStore.instance.getHttpAvatarUrl() ?? undefined,
129129
clientId: ELEMENT_CLIENT_ID,
130-
clientTheme: SettingsStore.getValue("theme"),
130+
clientTheme: new ThemeWatcher().getEffectiveTheme(),
131131
clientLanguage: getUserLanguage(),
132132
baseUrl: MatrixClientPeg.safeGet().baseUrl,
133133
});

src/stores/widgets/StopGapWidget.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import { MatrixClientPeg } from "../../MatrixClientPeg";
3737
import { OwnProfileStore } from "../OwnProfileStore";
3838
import WidgetUtils from "../../utils/WidgetUtils";
3939
import { IntegrationManagers } from "../../integrations/IntegrationManagers";
40-
import SettingsStore from "../../settings/SettingsStore";
4140
import { WidgetType } from "../../widgets/WidgetType";
4241
import ActiveWidgetStore from "../ActiveWidgetStore";
4342
import { objectShallowClone } from "../../utils/objects";
@@ -211,7 +210,7 @@ export class StopGapWidget extends EventEmitter {
211210
userDisplayName: OwnProfileStore.instance.displayName ?? undefined,
212211
userHttpAvatarUrl: OwnProfileStore.instance.getHttpAvatarUrl() ?? undefined,
213212
clientId: ELEMENT_CLIENT_ID,
214-
clientTheme: SettingsStore.getValue("theme"),
213+
clientTheme: new ThemeWatcher().getEffectiveTheme(),
215214
clientLanguage: getUserLanguage(),
216215
deviceId: this.client.getDeviceId() ?? undefined,
217216
baseUrl: this.client.baseUrl,

0 commit comments

Comments
 (0)