This repository has been archived by the owner on May 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: App Crashing on background for IAP users
- Use `CancellableContinuation` instated of `Continuation`. - Resume `continuation` with results if active and not completed. fixes: LEARNER-9527
- Loading branch information
1 parent
fd873a1
commit 88275e0
Showing
2 changed files
with
16 additions
and
6 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
OpenEdXMobile/src/main/java/org/edx/mobile/extenstion/ContinuationExt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.edx.mobile.extenstion | ||
|
||
import kotlinx.coroutines.CancellableContinuation | ||
import kotlin.coroutines.resume | ||
|
||
fun CancellableContinuation<Boolean>.resumeIfActive(value: Boolean) { | ||
if (isActive && isCompleted.not()) { | ||
resume(value) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters