From 4f25daa9ce4a752d62fece8118ad3416aa226eea Mon Sep 17 00:00:00 2001 From: Larry Date: Thu, 13 Jul 2023 10:17:58 -0400 Subject: [PATCH] replace deprecated channel method --- .../src/test/java/com/intuit/player/android/utils/updates.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/player/src/test/java/com/intuit/player/android/utils/updates.kt b/android/player/src/test/java/com/intuit/player/android/utils/updates.kt index 0c8c9538c..f628b6fd6 100644 --- a/android/player/src/test/java/com/intuit/player/android/utils/updates.kt +++ b/android/player/src/test/java/com/intuit/player/android/utils/updates.kt @@ -29,12 +29,12 @@ internal fun AndroidPlayer.updates(flow: JsonElement, take: Int = 1) = updates(f internal fun AndroidPlayer.updates(flow: String, take: Int = 1): Flow = callbackFlow { var count = 0 onUpdate { asset, _ -> - offer(Update.Asset(asset, count)) + trySend(Update.Asset(asset, count)).isSuccess if (++count >= take) close() } hooks.state.tap { state -> - offer(Update.State(state ?: ErrorState.from("state was null"))) + trySend(Update.State(state ?: ErrorState.from("state was null"))).isSuccess } start(flow).onComplete {