1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-13 00:42:49 -05:00

errors: generally, handle errors more gracefully with toasts

This commit is contained in:
bbedward
2025-11-05 12:22:02 -05:00
parent 16ad5221eb
commit fd49a171c0
3 changed files with 112 additions and 34 deletions

View File

@@ -78,7 +78,7 @@ Singleton {
const trimmedLines = lines.map(line => line.replace(/\s+$/, '')).filter(line => line.length > 0)
configValidationOutput = trimmedLines.join('\n').trim()
if (hasInitialConnection) {
ToastService.showError("niri: failed to load config", configValidationOutput)
ToastService.showError("niri: failed to load config", configValidationOutput, "", "niri-config")
}
}
}
@@ -498,12 +498,10 @@ Singleton {
validateProcess.running = true
} else {
configValidationOutput = ""
if (ToastService.toastVisible && ToastService.currentLevel === ToastService.levelError && ToastService.currentMessage.startsWith("niri:")) {
ToastService.hideToast()
}
ToastService.dismissCategory("niri-config")
fetchOutputs()
if (hasInitialConnection && !suppressConfigToast && !suppressNextConfigToast && !matugenSuppression) {
ToastService.showInfo("niri: config reloaded")
ToastService.showInfo("niri: config reloaded", "", "", "niri-config")
} else if (suppressNextConfigToast) {
suppressNextConfigToast = false
suppressResetTimer.stop()