limit rate notifications

This commit is contained in:
Iuri Matias 2020-07-22 11:35:14 -04:00
parent e0852d2f73
commit 338566a7bb
1 changed files with 10 additions and 6 deletions

View File

@ -9,6 +9,13 @@ Item {
id: root
property var chatId: ""
property var message: "hello"
property var processClick : Backpressure.oneInTime(root, 1000, function(chatId, msg) {
this.chatId = chatId
this.message = msg
notificationSound.play()
var w1 = winInit.createObject(null)
w1.destroy()
});
Component {
id: winInit
@ -81,12 +88,9 @@ Item {
}
function notifyUser(chatId, msg) {
this.chatId = chatId
this.message = msg
notificationSound.play()
var w1 = winInit.createObject(null)
w1.destroy()
}
processClick(chatId, msg)
}
}
/*##^##