Various fixes

This commit is contained in:
Ilya Laktyushin
2021-10-27 22:02:55 +04:00
parent b33d7888b8
commit 452a45d71d
6 changed files with 43 additions and 20 deletions

View File

@@ -366,10 +366,8 @@ public struct AutomaticThemeSwitchSetting: Codable, Equatable {
self.trigger = try container.decode(AutomaticThemeSwitchTrigger.self, forKey: "trigger")
if let themeData = try container.decodeIfPresent(AdaptedPostboxDecoder.RawObjectData.self, forKey: "theme_v2") {
self.theme = PresentationThemeReference(decoder: PostboxDecoder(buffer: MemoryBuffer(data: themeData.data)))
} else if let legacyValue = try container.decodeIfPresent(Int32.self, forKey: "theme") {
self.theme = .builtin(PresentationBuiltinThemeReference(rawValue: legacyValue) ?? .nightAccent)
} else {
self.theme = .builtin(.nightAccent)
self.theme = .builtin(.night)
}
}