mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Various fixes
This commit is contained in:
@@ -235,7 +235,6 @@ public struct WebAppParameters {
|
||||
public func generateWebAppThemeParams(_ presentationTheme: PresentationTheme) -> [String: Any] {
|
||||
let backgroundColor = presentationTheme.list.plainBackgroundColor.rgb
|
||||
let secondaryBackgroundColor = presentationTheme.list.blocksBackgroundColor.rgb
|
||||
|
||||
return [
|
||||
"bg_color": Int32(bitPattern: backgroundColor),
|
||||
"secondary_bg_color": Int32(bitPattern: secondaryBackgroundColor),
|
||||
@@ -329,6 +328,13 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
strongSelf.handleScriptMessage(delayedScriptMessage)
|
||||
}
|
||||
}
|
||||
if #available(iOS 13.0, *) {
|
||||
if self.presentationData.theme.overallDarkAppearance {
|
||||
webView.overrideUserInterfaceStyle = .dark
|
||||
} else {
|
||||
webView.overrideUserInterfaceStyle = .unspecified
|
||||
}
|
||||
}
|
||||
self.webView = webView
|
||||
|
||||
self.addSubnode(self.backgroundNode)
|
||||
@@ -1120,6 +1126,14 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
||||
}
|
||||
self.updateHeaderBackgroundColor(transition: .immediate)
|
||||
self.sendThemeChangedEvent()
|
||||
|
||||
if #available(iOS 13.0, *) {
|
||||
if self.presentationData.theme.overallDarkAppearance {
|
||||
self.webView?.overrideUserInterfaceStyle = .dark
|
||||
} else {
|
||||
self.webView?.overrideUserInterfaceStyle = .unspecified
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func sendThemeChangedEvent() {
|
||||
|
||||
Reference in New Issue
Block a user