diff --git a/vector/src/main/java/im/vector/app/features/widgets/WidgetArgsBuilder.kt b/vector/src/main/java/im/vector/app/features/widgets/WidgetArgsBuilder.kt index daca84add4..7c7424df8c 100644 --- a/vector/src/main/java/im/vector/app/features/widgets/WidgetArgsBuilder.kt +++ b/vector/src/main/java/im/vector/app/features/widgets/WidgetArgsBuilder.kt @@ -49,14 +49,6 @@ class WidgetArgsBuilder @Inject constructor( ) } - private fun getTheme(): String { - return if (ThemeUtils.isLightTheme(context)) { - "light" - } else { - "dark" - } - } - @Suppress("UNCHECKED_CAST") fun buildStickerPickerArgs(roomId: String, widget: Widget): WidgetArgs { val widgetId = widget.widgetId @@ -68,7 +60,8 @@ class WidgetArgsBuilder @Inject constructor( widgetId = widgetId, urlParams = mapOf( "widgetId" to widgetId, - "room_id" to roomId + "room_id" to roomId, + "theme" to getTheme() ).filterNotNull() ) } @@ -80,7 +73,10 @@ class WidgetArgsBuilder @Inject constructor( baseUrl = baseUrl, kind = WidgetKind.ROOM, roomId = roomId, - widgetId = widgetId + widgetId = widgetId, + urlParams = mapOf( + "theme" to getTheme() + ).filterNotNull() ) } @@ -88,4 +84,12 @@ class WidgetArgsBuilder @Inject constructor( private fun Map.filterNotNull(): Map { return filterValues { it != null } as Map } + + private fun getTheme(): String { + return if (ThemeUtils.isLightTheme(context)) { + "light" + } else { + "dark" + } + } }