alertOnMessageForMsec: correctly handle 0 value

If 0: don't show any alert
If -1: show alert indefinitly until user focuses the window
This commit is contained in:
miruka 2020-03-24 11:31:32 -04:00
parent 684ddd364c
commit 379a851a62

View File

@ -11,8 +11,10 @@ QtObject {
function onAlertRequested() { function onAlertRequested() {
if (Qt.application.state !== Qt.ApplicationActive) { const msec = window.settings.alertOnMessageForMsec
window.alert(window.settings.alertOnMessageForMsec)
if (Qt.application.state !== Qt.ApplicationActive && msec !== 0) {
window.alert(msec === -1 ? 0 : msec) // -1 0 = no time out
} }
} }