fix: clear stale terminal notification when a new flow starts

This commit is contained in:
OneWay authored and Evgenii committed 2026-09-21 08:59:12 +08:00
1 parent 451267688a
commit df96deb1fc
3 files changed
+6

No files matched your search

@@ -32,6 +32,7 @@ class DictionaryProgressPresenter(
fun beginFlow() {
terminalActive = false
notifications.cancelTerminalNotification()
}
override fun showImportSuccess() {
@@ -6,5 +6,6 @@ interface NotificationPort {
fun showDownloadSuccess()
fun showError()
fun cancelProgressNotification()
fun cancelTerminalNotification()
fun hasActiveProgressNotification(): Boolean
}
@@ -111,6 +111,10 @@ class NotificationHelper(private val context: Context) : NotificationPort {
notificationManager.cancel(NOTIFICATION_ID)
}
override fun cancelTerminalNotification() {
notificationManager.cancel(TERMINAL_NOTIFICATION_ID)
}
override fun hasActiveProgressNotification(): Boolean = lastNotificationKey != 0
fun showUnifiedProgressNotification(