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

View File

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

View File

@ -28,7 +28,7 @@ interface VectorAlert {
val title: String val title: String
val description: String val description: String
val iconId: Int? val iconId: Int?
val shouldBeDisplayedIn: ((Activity) -> Boolean)? val shouldBeDisplayedIn: ((Activity) -> Boolean)
data class Button(val title: String, val action: Runnable, val autoClose: 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 title: String,
override val description: String, override val description: String,
@DrawableRes override val iconId: Int?, @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 // will be set by manager, and accessible by actions at runtime
override var weakCurrentActivity: WeakReference<Activity>? = null override var weakCurrentActivity: WeakReference<Activity>? = null
@ -87,7 +91,10 @@ class VerificationVectorAlert(uid: String,
title: String, title: String,
override val description: String, override val description: String,
@DrawableRes override val iconId: Int?, @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( ) : DefaultVectorAlert(
uid, title, description, iconId, shouldBeDisplayedIn uid, title, description, iconId, shouldBeDisplayedIn
) { ) {