This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,8 @@ import { ElementWidgetActions } from "./ElementWidgetActions";
5151import Modal from "../../Modal" ;
5252import WidgetOpenIDPermissionsDialog from "../../components/views/dialogs/WidgetOpenIDPermissionsDialog" ;
5353import { 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 } ;
You can’t perform that action at this time.
0 commit comments