fix: clear stale terminal notification when a new flow starts
This commit is contained in:
1 parent
451267688a
commit
df96deb1fc
3 files changed
+6
No files matched your search
@@ -32,6 +32,7 @@ class DictionaryProgressPresenter(
|
|||||||
|
|
||||||
fun beginFlow() {
|
fun beginFlow() {
|
||||||
terminalActive = false
|
terminalActive = false
|
||||||
|
notifications.cancelTerminalNotification()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun showImportSuccess() {
|
override fun showImportSuccess() {
|
||||||
|
|||||||
@@ -6,5 +6,6 @@ interface NotificationPort {
|
|||||||
fun showDownloadSuccess()
|
fun showDownloadSuccess()
|
||||||
fun showError()
|
fun showError()
|
||||||
fun cancelProgressNotification()
|
fun cancelProgressNotification()
|
||||||
|
fun cancelTerminalNotification()
|
||||||
fun hasActiveProgressNotification(): Boolean
|
fun hasActiveProgressNotification(): Boolean
|
||||||
}
|
}
|
||||||
@@ -111,6 +111,10 @@ class NotificationHelper(private val context: Context) : NotificationPort {
|
|||||||
notificationManager.cancel(NOTIFICATION_ID)
|
notificationManager.cancel(NOTIFICATION_ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun cancelTerminalNotification() {
|
||||||
|
notificationManager.cancel(TERMINAL_NOTIFICATION_ID)
|
||||||
|
}
|
||||||
|
|
||||||
override fun hasActiveProgressNotification(): Boolean = lastNotificationKey != 0
|
override fun hasActiveProgressNotification(): Boolean = lastNotificationKey != 0
|
||||||
|
|
||||||
fun showUnifiedProgressNotification(
|
fun showUnifiedProgressNotification(
|
||||||
|
|||||||
Reference in new issue
Block a user