hide notification when app is foreground

pull/144/head
ryanzhao 4 years ago
parent 263281101c
commit ad8ae2f2c5

@ -642,7 +642,8 @@ class NotificationActionHandler {
func showThread(userInfo: [AnyHashable: Any]) throws -> Promise<Void> {
guard let threadId = userInfo[AppNotificationUserInfoKey.threadId] as? String else {
throw NotificationError.failDebug("threadId was unexpectedly nil")
return showHomePage()
// throw NotificationError.failDebug("threadId was unexpectedly nil")
}
// If this happens when the the app is not, visible we skip the animation so the thread
@ -652,6 +653,11 @@ class NotificationActionHandler {
signalApp.presentConversationAndScrollToFirstUnreadMessage(forThreadId: threadId, animated: shouldAnimate)
return Promise.value(())
}
func showHomePage() -> Promise<Void> {
signalApp.showHomeView()
return Promise.value(())
}
private func markAsRead(thread: TSThread) -> Promise<Void> {
return dbConnection.readWritePromise { transaction in

Loading…
Cancel
Save