From c2cbeb552f3b911ab27d305964e42e8d95918c5c Mon Sep 17 00:00:00 2001 From: Maximilian Bauer Date: Fri, 15 Jul 2022 23:29:58 +0200 Subject: [PATCH] LicenseVC: fixing crash on enter background --- Amperfy/Screens/ViewController/LicenseVC.swift | 4 +++- Amperfy/Screens/ViewController/SettingsXCallbackURLsVC.swift | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Amperfy/Screens/ViewController/LicenseVC.swift b/Amperfy/Screens/ViewController/LicenseVC.swift index e08186c0..4ecaf047 100644 --- a/Amperfy/Screens/ViewController/LicenseVC.swift +++ b/Amperfy/Screens/ViewController/LicenseVC.swift @@ -336,7 +336,9 @@ class LicenseVC: UIViewController { // handle dark/light mode change override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) - updateView() + DispatchQueue.main.async { + self.updateView() + } } } diff --git a/Amperfy/Screens/ViewController/SettingsXCallbackURLsVC.swift b/Amperfy/Screens/ViewController/SettingsXCallbackURLsVC.swift index f5899246..26daacd9 100644 --- a/Amperfy/Screens/ViewController/SettingsXCallbackURLsVC.swift +++ b/Amperfy/Screens/ViewController/SettingsXCallbackURLsVC.swift @@ -23,7 +23,9 @@ class SettingsXCallbackURLsVC: UIViewController { // handle dark/light mode change override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) - updateView() + DispatchQueue.main.async { + self.updateView() + } } func updateView() {