Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ constructor(
override var isInForeground = false
private set

private var pendingForegroundCheck = false

/**
* Either notify the subscribers with general multi-process supported session or fallback local
* session
Expand Down Expand Up @@ -93,6 +95,10 @@ constructor(
}
.collect { sessionData ->
localSessionData = sessionData
if (pendingForegroundCheck) {
pendingForegroundCheck = false
appForeground()
}
val sessionId = sessionData.sessionDetails.sessionId
notifySubscribers(sessionId, NotificationType.GENERAL)
}
Expand Down Expand Up @@ -122,6 +128,7 @@ constructor(
override fun appForeground() {
isInForeground = true
if (!::localSessionData.isInitialized) {
pendingForegroundCheck = true
Log.d(TAG, "App foregrounded, but local SessionData not initialized")
return
}
Expand Down
Loading