mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Add web app theme request
This commit is contained in:
parent
6e4b9a82e9
commit
2c4dd3d411
@ -460,6 +460,8 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
|||||||
if let (layout, navigationBarHeight) = self.validLayout {
|
if let (layout, navigationBarHeight) = self.validLayout {
|
||||||
self.containerLayoutUpdated(layout, navigationBarHeight: navigationBarHeight, transition: .immediate)
|
self.containerLayoutUpdated(layout, navigationBarHeight: navigationBarHeight, transition: .immediate)
|
||||||
}
|
}
|
||||||
|
case "web_app_request_theme":
|
||||||
|
self.sendThemeChangedEvent()
|
||||||
case "web_app_expand":
|
case "web_app_expand":
|
||||||
self.controller?.requestAttachmentMenuExpansion()
|
self.controller?.requestAttachmentMenuExpansion()
|
||||||
case "web_app_close":
|
case "web_app_close":
|
||||||
@ -498,7 +500,10 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
|||||||
} else {
|
} else {
|
||||||
self.backgroundColor = self.presentationData.theme.list.plainBackgroundColor
|
self.backgroundColor = self.presentationData.theme.list.plainBackgroundColor
|
||||||
}
|
}
|
||||||
|
self.sendThemeChangedEvent()
|
||||||
|
}
|
||||||
|
|
||||||
|
private func sendThemeChangedEvent() {
|
||||||
let themeParams = generateWebAppThemeParams(presentationData.theme)
|
let themeParams = generateWebAppThemeParams(presentationData.theme)
|
||||||
var themeParamsString = "{theme_params: {"
|
var themeParamsString = "{theme_params: {"
|
||||||
for (key, value) in themeParams {
|
for (key, value) in themeParams {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user