desktop: show toast if failed to show notification (#3955)

* desktop: show toast if failed to show notification

* longer timeout

* returned old version of the lib
This commit is contained in:
Stanislav Dmitrenko
2024-03-26 19:43:45 +07:00
committed by GitHub
parent 1d698c114f
commit 96fb61ccfc
3 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ kotlin {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.8.0")
implementation("com.github.Dansoftowner:jSystemThemeDetector:3.8")
implementation("com.sshtools:two-slices:0.9.3")
implementation("com.sshtools:two-slices:0.9.0-SNAPSHOT")
implementation("org.slf4j:slf4j-simple:2.0.12")
implementation("uk.co.caprica:vlcj:4.8.2")
implementation("com.github.NanoHttpd.nanohttpd:nanohttpd:efb2ebf85a")
@@ -211,6 +211,7 @@
<string name="notification_preview_new_message">new message</string>
<string name="notification_new_contact_request">New contact request</string>
<string name="notification_contact_connected">Connected</string>
<string name="error_showing_desktop_notification">Error showing notification, contact developers.</string>
<!-- local authentication notice - SimpleXAPI.kt -->
<string name="la_notice_title_simplex_lock">SimpleX Lock</string>
@@ -111,8 +111,12 @@ object NtfManager {
}
try {
prevNtfs.add(chatId to builder.toast())
} catch (e: Exception) {
} catch (e: Throwable) {
Log.e(TAG, e.stackTraceToString())
if (e !is Exception) {
val text = e.stackTraceToString().lines().getOrNull(0) ?: ""
showToast(generalGetString(MR.strings.error_showing_desktop_notification) + " " + text, 4_000)
}
}
}