close window once to avoid app showing blank screen

This commit is contained in:
Iuri Matias 2020-07-22 14:27:11 -04:00
parent 338566a7bb
commit 21cdcfcb87

View File

@ -9,9 +9,7 @@ Item {
id: root id: root
property var chatId: "" property var chatId: ""
property var message: "hello" property var message: "hello"
property var processClick : Backpressure.oneInTime(root, 1000, function(chatId, msg) { property var processClick : Backpressure.oneInTime(root, 1000, function() {
this.chatId = chatId
this.message = msg
notificationSound.play() notificationSound.play()
var w1 = winInit.createObject(null) var w1 = winInit.createObject(null)
w1.destroy() w1.destroy()
@ -54,7 +52,6 @@ Item {
onClicked: { onClicked: {
timer.stop() timer.stop()
notificationWindowSub.close() notificationWindowSub.close()
notificationWindowSub.destroy()
mainWin.destroy() mainWin.destroy()
applicationWindow.raise() applicationWindow.raise()
chatsModel.setActiveChannel(chatId); chatsModel.setActiveChannel(chatId);
@ -70,7 +67,6 @@ Item {
repeat: false repeat: false
onTriggered: { onTriggered: {
notificationWindowSub.close() notificationWindowSub.close()
notificationWindowSub.destroy()
} }
} }
onVisibleChanged: { onVisibleChanged: {
@ -88,7 +84,9 @@ Item {
} }
function notifyUser(chatId, msg) { function notifyUser(chatId, msg) {
processClick(chatId, msg) this.chatId = chatId
this.message = msg
processClick()
} }
} }