Skip to content

Commit cdf73ad

Browse files
committed
clear timeout
1 parent 46589dd commit cdf73ad

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

services/static-webserver/client/source/class/osparc/FlashMessenger.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ qx.Class.define("osparc.FlashMessenger", {
8989
const flashMessage = this.getInstance().logAs(msg, "ERROR", duration);
9090
error["supportId"] = "1234";
9191
if (error && error["supportId"]) {
92-
flashMessage.addWidget(this.self().createCopyEOCWidget(error["supportId"]));
92+
flashMessage.addWidget(this.__createCopyEOCWidget(flashMessage, error["supportId"]));
9393
}
9494
return flashMessage;
9595
},
9696

97-
createCopyEOCWidget: function(supportId) {
97+
__createCopyEOCWidget: function(flashMessage, supportId) {
9898
const widget = new qx.ui.container.Composite(new qx.ui.layout.VBox()).set({
9999
paddingLeft: 10
100100
});
@@ -123,6 +123,12 @@ qx.Class.define("osparc.FlashMessenger", {
123123
showErrorLabel.exclude();
124124
hideErrorLabel.show();
125125
errorLabel.show();
126+
127+
if (flashMessage.timer) {
128+
// let the user close it
129+
clearTimeout(flashMessage.timer);
130+
delete flashMessage.timer;
131+
}
126132
});
127133
hideErrorLabel.addListener("tap", () => {
128134
hideErrorLabel.exclude();
@@ -189,7 +195,7 @@ qx.Class.define("osparc.FlashMessenger", {
189195

190196
const duration = flashMessage.getDuration();
191197
if (duration !== 0) {
192-
qx.event.Timer.once(() => this.removeMessage(flashMessage), this, duration);
198+
flashMessage.timer = setTimeout(() => this.removeMessage(flashMessage), duration);
193199
}
194200
},
195201

services/static-webserver/client/source/class/osparc/ui/message/FlashMessage.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ qx.Class.define("osparc.ui.message.FlashMessage", {
7575
check: "Number",
7676
init: null,
7777
nullable: true,
78-
event: "changeDuration",
7978
}
8079
},
8180

0 commit comments

Comments
 (0)