diff --git a/submodules/SettingsUI/Sources/Themes/ThemePreviewController.swift b/submodules/SettingsUI/Sources/Themes/ThemePreviewController.swift index 8f9a1640c5..89df4dfc00 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemePreviewController.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemePreviewController.swift @@ -224,7 +224,7 @@ public final class ThemePreviewController: ViewController { return telegramThemes(postbox: context.account.postbox, network: context.account.network, accountManager: context.sharedContext.accountManager) |> take(1) |> mapToSignal { themes -> Signal in - let similarTheme = themes.filter { $0.isCreator && $0.title == info.title }.first + let similarTheme = themes.first(where: { $0.isCreator && $0.title == info.title }) if let similarTheme = similarTheme { return updateTheme(account: context.account, accountManager: context.sharedContext.accountManager, theme: similarTheme, title: nil, slug: nil, resource: info.resource, thumbnailData: themeThumbnailData) |> map(Optional.init) diff --git a/submodules/TelegramCore/TelegramCore/Themes.swift b/submodules/TelegramCore/TelegramCore/Themes.swift index 8aead71fd5..e9a10c1eb9 100644 --- a/submodules/TelegramCore/TelegramCore/Themes.swift +++ b/submodules/TelegramCore/TelegramCore/Themes.swift @@ -576,7 +576,7 @@ public func actualizedTheme(account: Account, accountManager: AccountManager, th } } |> map { themes -> TelegramTheme in - let updatedTheme = themes.filter { $0.id == theme.id }.first + let updatedTheme = themes.first(where: { $0.id == theme.id }) if let updatedTheme = updatedTheme { if !areThemesEqual(updatedTheme, currentTheme) { currentTheme = updatedTheme