From bc397e993d3835c35e4d0669900286745a1ae0dc Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Thu, 28 Nov 2024 19:15:44 +0100 Subject: [PATCH] fix deprecated `resume` call in AlertDialogExtensions (#4775) --- .../com/keylesspalace/tusky/util/AlertDialogExtensions.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/util/AlertDialogExtensions.kt b/app/src/main/java/com/keylesspalace/tusky/util/AlertDialogExtensions.kt index 70362db50f..fb5184ac34 100644 --- a/app/src/main/java/com/keylesspalace/tusky/util/AlertDialogExtensions.kt +++ b/app/src/main/java/com/keylesspalace/tusky/util/AlertDialogExtensions.kt @@ -20,7 +20,6 @@ package com.keylesspalace.tusky.util import android.content.DialogInterface import androidx.annotation.StringRes import androidx.appcompat.app.AlertDialog -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.suspendCancellableCoroutine /** @@ -30,14 +29,13 @@ import kotlinx.coroutines.suspendCancellableCoroutine * @param negativeText Optional text to show on the negative button * @param neutralText Optional text to show on the neutral button */ -@OptIn(ExperimentalCoroutinesApi::class) suspend fun AlertDialog.await( positiveText: String, negativeText: String? = null, neutralText: String? = null ) = suspendCancellableCoroutine { cont -> val listener = DialogInterface.OnClickListener { _, which -> - cont.resume(which) { dismiss() } + cont.resume(which) { _, _, _ -> dismiss() } } setButton(AlertDialog.BUTTON_POSITIVE, positiveText, listener)