add timeout to message box notifications (#5689)

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
Simon Smith
2024-01-12 22:46:12 +00:00
committed by GitHub
parent cb0b02152a
commit 00db0a3a39
3 changed files with 53 additions and 20 deletions

View File

@@ -1230,8 +1230,11 @@ function handleServerCommand(data) {
ipr.message = data.msg;
ipr.username = data.username;
if (data.realname && (data.realname != '')) { ipr.username = data.realname; }
ipr.timeout = (typeof data.timeout === 'number' ? data.timeout : 120000);
global._clientmessage = ipr.then(function (img) {
this.messagebox = require('win-dialog').create(this.title, this.message, this.username, { timeout: 120000, b64Image: img.split(',').pop(), background: color_options.background, foreground: color_options.foreground });
var options = { b64Image: img.split(',').pop(), background: color_options.background, foreground: color_options.foreground }
if (this.timeout != 0) { options.timeout = this.timeout; }
this.messagebox = require('win-dialog').create(this.title, this.message, this.username, options);
this.__childPromise.addMessage = this.messagebox.addMessage.bind(this.messagebox);
return (this.messagebox);
});