From 610f3ffbe7b6427de115e7c8cbf24536ef027f4f Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Mon, 9 Sep 2019 11:33:53 +0300 Subject: [PATCH] Fixed typo --- .../SettingsUI/Sources/Themes/ThemePreviewController.swift | 2 +- submodules/TelegramCore/TelegramCore/Themes.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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