Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 17717e2

Browse files
committed
Fix theme variable passed to Jitsi
1 parent 646ed4c commit 17717e2

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/stores/widgets/StopGapWidget.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ import { ElementWidgetActions } from "./ElementWidgetActions";
5151
import Modal from "../../Modal";
5252
import WidgetOpenIDPermissionsDialog from "../../components/views/dialogs/WidgetOpenIDPermissionsDialog";
5353
import {ModalWidgetStore} from "../ModalWidgetStore";
54+
import ThemeWatcher from "../../settings/watchers/ThemeWatcher";
55+
import {getCustomTheme} from "../../theme";
5456

5557
// TODO: Destroy all of this code
5658

@@ -104,9 +106,25 @@ class ElementWidget extends Widget {
104106
// v1 widgets default to jitsi.riot.im regardless of user settings
105107
domain = "jitsi.riot.im";
106108
}
109+
110+
let theme = new ThemeWatcher().getEffectiveTheme();
111+
if (theme.startsWith("custom-")) {
112+
const customTheme = getCustomTheme(theme.substr(7));
113+
// Jitsi only understands light/dark
114+
theme = customTheme.is_dark ? "dark" : "light";
115+
}
116+
117+
// only allow light/dark through, defaulting to dark as that was previously the only state
118+
// accounts for legacy-light/legacy-dark themes too
119+
if (theme.includes("light")) {
120+
theme = "light";
121+
} else {
122+
theme = "dark";
123+
}
124+
107125
return {
108126
...super.rawData,
109-
theme: SettingsStore.getValue("theme"),
127+
theme,
110128
conferenceId,
111129
domain,
112130
};

0 commit comments

Comments
 (0)