Skip to content

Commit 7310a64

Browse files
robintowntoger5
authored andcommitted
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 ddf221b commit 7310a64

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
@@ -33,7 +33,7 @@ import { OwnProfileStore } from "../../../stores/OwnProfileStore";
3333
import { arrayFastClone } from "../../../utils/arrays";
3434
import { ElementWidget } from "../../../stores/widgets/StopGapWidget";
3535
import { ELEMENT_CLIENT_ID } from "../../../identifiers";
36-
import SettingsStore from "../../../settings/SettingsStore";
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
@@ -43,7 +43,6 @@ import { MatrixClientPeg } from "../../MatrixClientPeg";
4343
import { OwnProfileStore } from "../OwnProfileStore";
4444
import WidgetUtils from "../../utils/WidgetUtils";
4545
import { IntegrationManagers } from "../../integrations/IntegrationManagers";
46-
import SettingsStore from "../../settings/SettingsStore";
4746
import { WidgetType } from "../../widgets/WidgetType";
4847
import ActiveWidgetStore from "../ActiveWidgetStore";
4948
import { objectShallowClone } from "../../utils/objects";
@@ -213,7 +212,7 @@ export class StopGapWidget extends EventEmitter {
213212
userDisplayName: OwnProfileStore.instance.displayName ?? undefined,
214213
userHttpAvatarUrl: OwnProfileStore.instance.getHttpAvatarUrl() ?? undefined,
215214
clientId: ELEMENT_CLIENT_ID,
216-
clientTheme: SettingsStore.getValue("theme"),
215+
clientTheme: new ThemeWatcher().getEffectiveTheme(),
217216
clientLanguage: getUserLanguage(),
218217
deviceId: this.client.getDeviceId() ?? undefined,
219218
baseUrl: this.client.baseUrl,

0 commit comments

Comments
 (0)