aurora667975a
aurora: fix notification popup timeout (ms, not s), default 15s
+3 −2
1 file changed
| @@ -39,8 +39,9 @@ Singleton { | |||
| 39 | 39 | } | |
| 40 | 40 | function push(n) { | |
| 41 | 41 | playSound() | |
| 42 | − | var ms = n.urgency === NotificationUrgency.Critical ? 12000 | |
| 43 | − | : (n.expireTimeout > 0 ? n.expireTimeout * 1000 : 5000) | |
| 42 | + | // expireTimeout is already in ms; apps asking for less than 15s get less, never more | |
| 43 | + | var ms = (n.urgency !== NotificationUrgency.Critical && n.expireTimeout > 0) | |
| 44 | + | ? Math.min(n.expireTimeout, 15000) : 15000 | |
| 44 | 45 | var next = popups.concat([{ n: n, until: Date.now() + ms }]) | |
| 45 | 46 | popups = next.slice(-4) | |
| 46 | 47 | n.closed.connect(function () { root.dropPopup(n) }) | |