mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Fix one-time intents reset
This commit is contained in:
@@ -981,8 +981,6 @@ final class SharedApplicationContext {
|
||||
|> deliverOnMainQueue).start(next: { context in
|
||||
if let context = context {
|
||||
self.registerForNotifications(context: context.context, authorize: false)
|
||||
|
||||
self.resetIntentsIfNeeded(context: context.context)
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -1126,6 +1124,8 @@ final class SharedApplicationContext {
|
||||
authorizeNotifications = false
|
||||
}
|
||||
self.registerForNotifications(context: context.context, authorize: authorizeNotifications)
|
||||
|
||||
self.resetIntentsIfNeeded(context: context.context)
|
||||
}))
|
||||
} else {
|
||||
self.mainWindow.viewController = nil
|
||||
@@ -1970,7 +1970,7 @@ final class SharedApplicationContext {
|
||||
}
|
||||
|
||||
private func resetIntentsIfNeeded(context: AccountContextImpl) {
|
||||
let _ = context.sharedContext.accountManager.transaction { transaction in
|
||||
let _ = (context.sharedContext.accountManager.transaction { transaction in
|
||||
let settings = transaction.getSharedData(ApplicationSpecificSharedDataKeys.intentsSettings) as? IntentsSettings ?? IntentsSettings.defaultSettings
|
||||
if !settings.initiallyReset {
|
||||
if #available(iOS 10.0, *) {
|
||||
@@ -1982,7 +1982,7 @@ final class SharedApplicationContext {
|
||||
return IntentsSettings(initiallyReset: true)
|
||||
})
|
||||
}
|
||||
}
|
||||
}).start()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user