Skip to content

Commit 4d9e542

Browse files
committed
T120621: Fix quick action crash related to ad slot changes [Cherry picked]
1 parent eece73c commit 4d9e542

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

iMEGA/Ads/Views/AdSlots/MainTabBarWrapper.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ struct MainTabBarWrapper: UIViewControllerRepresentable {
55
private(set) var mainTabBar: UITabBarController
66

77
init(mainTabBar: UITabBarController) {
8+
_ = mainTabBar.view
89
self.mainTabBar = mainTabBar
910
}
1011

iMEGA/Cloud drive/CloudDriveViewController+ContextMenu.swift

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,16 @@ extension CloudDriveViewController: CloudDriveContextMenuDelegate {
254254
}
255255

256256
@objc func presentUploadOptions() {
257-
configureContextMenuManagerIfNeeded()
258257

259-
guard let config = uploadAddMenuConfiguration(),
260-
let actions = contextMenuManager?.actionSheetActions(with: config) else { return }
261-
262-
let actionSheetVC = ActionSheetViewController(actions: actions, headerTitle: nil, dismissCompletion: nil, sender: nil)
263-
present(actionSheetVC, animated: true)
258+
DispatchQueue.main.async {
259+
self.configureContextMenuManagerIfNeeded()
260+
261+
guard let config = self.uploadAddMenuConfiguration(),
262+
let actions = self.contextMenuManager?.actionSheetActions(with: config) else { return }
263+
264+
let actionSheetVC = ActionSheetViewController(actions: actions, headerTitle: nil, dismissCompletion: nil, sender: nil)
265+
self.present(actionSheetVC, animated: true)
266+
}
267+
264268
}
265269
}

0 commit comments

Comments
 (0)