From 0bdce8a93b72e8d9bfb6d0a394a54645665f4609 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Fri, 3 Jan 2020 16:06:59 +0400 Subject: [PATCH] Initialize MediaAutoDownloadNetworkType with NetworkType --- .../Sources/MediaAutoDownloadSettings.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/submodules/TelegramUIPreferences/Sources/MediaAutoDownloadSettings.swift b/submodules/TelegramUIPreferences/Sources/MediaAutoDownloadSettings.swift index 543a981aa8..905662b02b 100644 --- a/submodules/TelegramUIPreferences/Sources/MediaAutoDownloadSettings.swift +++ b/submodules/TelegramUIPreferences/Sources/MediaAutoDownloadSettings.swift @@ -10,6 +10,17 @@ public enum MediaAutoDownloadNetworkType { case cellular } +public extension MediaAutoDownloadNetworkType { + init(_ networkType: NetworkType) { + switch networkType { + case .none, .cellular: + self = .cellular + case .wifi: + self = .wifi + } + } +} + public enum MediaAutoDownloadPreset: Int32 { case low case medium