mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-01-20 04:48:08 +00:00
Correctly route notification at app launch
This commit is contained in:
parent
1f14311c2c
commit
05815e6d35
2 changed files with 2 additions and 1 deletions
|
@ -239,6 +239,7 @@ class AppDelegate: NSObject, UIApplicationDelegate {
|
||||||
didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool
|
didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool
|
||||||
{
|
{
|
||||||
try? AVAudioSession.sharedInstance().setCategory(.ambient, options: .mixWithOthers)
|
try? AVAudioSession.sharedInstance().setCategory(.ambient, options: .mixWithOthers)
|
||||||
|
PushNotificationsService.shared.setAccounts(accounts: AppAccountsManager.shared.pushAccounts)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ struct NotificationsTab: View {
|
||||||
}
|
}
|
||||||
.onChange(of: pushNotificationsService.handleNotification) { notification in
|
.onChange(of: pushNotificationsService.handleNotification) { notification in
|
||||||
if let notification, let type = notification.supportedType {
|
if let notification, let type = notification.supportedType {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
|
||||||
switch type {
|
switch type {
|
||||||
case .follow, .follow_request:
|
case .follow, .follow_request:
|
||||||
routerPath.navigate(to: .accountDetailWithAccount(account: notification.account))
|
routerPath.navigate(to: .accountDetailWithAccount(account: notification.account))
|
||||||
|
|
Loading…
Reference in a new issue