Verification popup won't show

This commit is contained in:
Benoit Marty 2020-09-04 20:38:32 +02:00
parent f6c7f3eed1
commit 254eb26211
3 changed files with 12 additions and 4 deletions

View file

@ -23,6 +23,7 @@ Bugfix 🐛:
- Can't handle ongoing call events in background (#1992)
- Crash / Attachment viewer: Cannot draw a recycled Bitmap #2034
- Login with Matrix-Id | Autodiscovery fails if identity server is invalid and Homeserver ok (#2027)
- Verification popup won't show
Translations 🗣:
-

View file

@ -254,6 +254,6 @@ class PopupAlertManager @Inject constructor(private val avatarRenderer: Lazy<Ava
return alert != null
&& activity !is PinActivity
&& activity is VectorBaseActivity
&& alert.shouldBeDisplayedIn?.invoke(activity) == true
&& alert.shouldBeDisplayedIn.invoke(activity)
}
}

View file

@ -28,7 +28,7 @@ interface VectorAlert {
val title: String
val description: String
val iconId: Int?
val shouldBeDisplayedIn: ((Activity) -> Boolean)?
val shouldBeDisplayedIn: ((Activity) -> Boolean)
data class Button(val title: String, val action: Runnable, val autoClose: Boolean)
@ -59,7 +59,11 @@ open class DefaultVectorAlert(override val uid: String,
override val title: String,
override val description: String,
@DrawableRes override val iconId: Int?,
override val shouldBeDisplayedIn: ((Activity) -> Boolean)? = null) : VectorAlert {
/**
* Alert are displayed by default, but let this lambda return false to prevent displaying
*/
override val shouldBeDisplayedIn: ((Activity) -> Boolean) = { true }
) : VectorAlert {
// will be set by manager, and accessible by actions at runtime
override var weakCurrentActivity: WeakReference<Activity>? = null
@ -87,7 +91,10 @@ class VerificationVectorAlert(uid: String,
title: String,
override val description: String,
@DrawableRes override val iconId: Int?,
override val shouldBeDisplayedIn: ((Activity) -> Boolean)? = null
/**
* Alert are displayed by default, but let this lambda return false to prevent displaying
*/
override val shouldBeDisplayedIn: ((Activity) -> Boolean) = { true }
) : DefaultVectorAlert(
uid, title, description, iconId, shouldBeDisplayedIn
) {