Skip to content

Commit 940d6f4

Browse files
authored
Avoid double presenting during provisioning flow
1 parent 5d3f8d9 commit 940d6f4

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Signal/Provisioning/UserInterface/ProvisioningController.swift

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,12 @@ class ProvisioningController: NSObject {
325325
}
326326

327327
func provisioningDidComplete(from viewController: UIViewController) {
328+
if viewController.presentedViewController != nil {
329+
viewController.dismiss(animated: true) {
330+
self.provisioningDidComplete(from: viewController)
331+
}
332+
return
333+
}
328334
SignalApp.shared.showConversationSplitView(appReadiness: appReadiness)
329335
}
330336

@@ -345,6 +351,12 @@ class ProvisioningController: NSObject {
345351
})
346352
return
347353
}
354+
if viewController.presentedViewController != nil {
355+
viewController.dismiss(animated: true, completion: {
356+
popAndThenAwaitProvisioning()
357+
})
358+
return
359+
}
348360
navigationController.popToViewController(viewController, animated: true)
349361
Task {
350362
await awaitProvisioning(
@@ -431,7 +443,9 @@ class ProvisioningController: NSObject {
431443
navigationController: navigationController,
432444
progressViewModel: progressViewModel
433445
)
434-
progressViewController.presentActionSheet(errorActionSheet)
446+
if progressViewController.presentedViewController == nil {
447+
progressViewController.presentActionSheet(errorActionSheet)
448+
}
435449
}
436450
}
437451
} else {

0 commit comments

Comments
 (0)