diff --git a/submodules/TelegramUI/Sources/AppDelegate.swift b/submodules/TelegramUI/Sources/AppDelegate.swift index 8e692119db..f28a25671b 100644 --- a/submodules/TelegramUI/Sources/AppDelegate.swift +++ b/submodules/TelegramUI/Sources/AppDelegate.swift @@ -2793,11 +2793,26 @@ private func extractAccountManagerState(records: AccountRecordsView take(1) + |> deliverOnMainQueue + |> mapToSignal { sharedApplicationContext -> Signal in + if let accountId = accountId { + sharedApplicationContext.sharedContext.switchToAccount(id: accountId) + return self.authorizedContext() + |> filter { context in + context.context.account.id == accountId + } + |> take(1) + } else { + return self.authorizedContext() + |> take(1) + } + } + self.openUrlWhenReadyDisposable.set((signal |> deliverOnMainQueue).start(next: { [weak self] context in context.openUrl(url, external: external) @@ -2813,7 +2828,7 @@ private func extractAccountManagerState(records: AccountRecordsView deliverOnMainQueue).start(next: { accountId in if let context = self.contextValue { - if let accountId = accountId, context.context.account.id != accountId { + if let accountId = accountId, context.context.account.id != accountId || notification.request.content.userInfo["url"] != nil { completionHandler([.alert]) } }