From 991cecdeb3c38617ffc79904fba7bbd52c898e0b Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Mon, 16 Sep 2024 10:49:46 +0800 Subject: [PATCH] Fix iPad split view (#8199) * Fix iPad split view * remove unused type def --- libraries/@mattermost/rnutils/ios/RNUtilsWrapper.swift | 7 ++++--- types/global/device.d.ts | 7 ------- 2 files changed, 4 insertions(+), 10 deletions(-) delete mode 100644 types/global/device.d.ts diff --git a/libraries/@mattermost/rnutils/ios/RNUtilsWrapper.swift b/libraries/@mattermost/rnutils/ios/RNUtilsWrapper.swift index 21a927a08..5e639e076 100644 --- a/libraries/@mattermost/rnutils/ios/RNUtilsWrapper.swift +++ b/libraries/@mattermost/rnutils/ios/RNUtilsWrapper.swift @@ -5,9 +5,10 @@ import React @objc public weak var delegate: RNUtilsDelegate? = nil deinit { - NotificationCenter.default.removeObserver(self, - name: NSNotification.Name.RCTUserInterfaceStyleDidChange, - object: nil) + DispatchQueue.main.async { + guard let w = UIApplication.shared.delegate?.window, let window = w else { return } + window.removeObserver(self, forKeyPath: "frame") + } } func getSharedDirectory() -> URL? { diff --git a/types/global/device.d.ts b/types/global/device.d.ts deleted file mode 100644 index 491099aac..000000000 --- a/types/global/device.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. - -type SplitViewResult = { - isSplitView: boolean; - isTablet: boolean; -}