diff --git a/CHANGES.md b/CHANGES.md index db98189499..c25d541d04 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 🗣: - diff --git a/vector/src/main/java/im/vector/app/features/popup/PopupAlertManager.kt b/vector/src/main/java/im/vector/app/features/popup/PopupAlertManager.kt index c52b586eb4..593527448b 100644 --- a/vector/src/main/java/im/vector/app/features/popup/PopupAlertManager.kt +++ b/vector/src/main/java/im/vector/app/features/popup/PopupAlertManager.kt @@ -254,6 +254,6 @@ class PopupAlertManager @Inject constructor(private val avatarRenderer: Lazy 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? = 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 ) {