Fix crashes when open the window

This commit is contained in:
Namhyeon Go 2022-11-29 02:49:58 +09:00
parent 327ef6c810
commit 8b0314a965
2 changed files with 11 additions and 5 deletions

2
app.js
View File

@ -70,7 +70,7 @@ var console = {
var params = {
type: type,
channel: 'default',
messsage: '',
message: '',
datetime: new Date().toISOString()
};

View File

@ -9,7 +9,13 @@ var OldBrowser = require("lib/oldbrowser");
// Override global.console._echo()
////////////////////////////////////////////////////////////////////////
global.console._echo = function(args, type) {
var heading, icon, msg = this._join(args);
var heading, icon, message = this._join(args);
var params = {
type: type,
channel: 'default',
message: '',
datetime: new Date().toISOString()
};
switch(type) {
case "error":
@ -36,17 +42,17 @@ global.console._echo = function(args, type) {
if (typeof(window.jQuery.toast) !== "undefined") {
window.jQuery.toast({
heading: heading,
text: msg,
text: message,
icon: icon
});
} else {
window.alert(msg);
window.alert(message);
}
} catch (e) {
window.alert(e.message);
}
this._messages.push(msg);
this._messages.push(message);
if (params.channel != "default" && this._echoCallback != null) {
try {