From 33f1cfcc77b11073b54585f97f1a3e48da063a9a Mon Sep 17 00:00:00 2001 From: CMK Date: Tue, 2 Mar 2021 12:01:11 +0800 Subject: [PATCH 1/2] fix: server description may display in HTML format issue. resolve: #30 --- .../PickServer/TableViewCell/PickServerCell.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Mastodon/Scene/Onboarding/PickServer/TableViewCell/PickServerCell.swift b/Mastodon/Scene/Onboarding/PickServer/TableViewCell/PickServerCell.swift index 0ded9392..fef09b95 100644 --- a/Mastodon/Scene/Onboarding/PickServer/TableViewCell/PickServerCell.swift +++ b/Mastodon/Scene/Onboarding/PickServer/TableViewCell/PickServerCell.swift @@ -8,6 +8,7 @@ import UIKit import MastodonSDK import Kingfisher +import Kanna protocol PickServerCellDelegate: class { func pickServerCell(modeChange server: Mastodon.Entity.Server, newMode: PickServerCell.Mode, updates: (() -> Void)) @@ -326,7 +327,13 @@ extension PickServerCell { private func updateServerInfo() { guard let serverInfo = server else { return } domainLabel.text = serverInfo.domain - descriptionLabel.text = serverInfo.description + descriptionLabel.text = { + guard let html = try? HTML(html: serverInfo.description, encoding: .utf8) else { + return serverInfo.description + } + + return html.text ?? serverInfo.description + }() let processor = RoundCornerImageProcessor(cornerRadius: 3) thumbImageView.kf.indicatorType = .activity thumbImageView.kf.setImage(with: URL(string: serverInfo.proxiedThumbnail ?? "")!, placeholder: UIImage.placeholder(color: Asset.Colors.lightBackground.color), options: [ From ba283bbdcb40c10508f999682543d4c03d028a10 Mon Sep 17 00:00:00 2001 From: CMK Date: Thu, 4 Mar 2021 10:51:49 +0800 Subject: [PATCH 2/2] fix: appVersion not set issue --- .../mainasuk.xcuserdatad/xcschemes/xcschememanagement.plist | 4 ++-- Mastodon/Supporting Files/AppDelegate.swift | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Mastodon.xcodeproj/xcuserdata/mainasuk.xcuserdatad/xcschemes/xcschememanagement.plist b/Mastodon.xcodeproj/xcuserdata/mainasuk.xcuserdatad/xcschemes/xcschememanagement.plist index b1a7a744..bc78dfa4 100644 --- a/Mastodon.xcodeproj/xcuserdata/mainasuk.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/Mastodon.xcodeproj/xcuserdata/mainasuk.xcuserdatad/xcschemes/xcschememanagement.plist @@ -17,12 +17,12 @@ Mastodon - Release.xcscheme_^#shared#^_ orderHint - 1 + 2 Mastodon.xcscheme_^#shared#^_ orderHint - 0 + 1 SuppressBuildableAutocreation diff --git a/Mastodon/Supporting Files/AppDelegate.swift b/Mastodon/Supporting Files/AppDelegate.swift index cfac7f1a..00d839b5 100644 --- a/Mastodon/Supporting Files/AppDelegate.swift +++ b/Mastodon/Supporting Files/AppDelegate.swift @@ -13,11 +13,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate { let appContext = AppContext() func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - return true // Update app version info. See: `Settings.bundle` UserDefaults.standard.setValue(UIApplication.appVersion(), forKey: "Mastodon.appVersion") UserDefaults.standard.setValue(UIApplication.appBuild(), forKey: "Mastodon.appBundle") + + return true } // MARK: UISceneSession Lifecycle