diff --git a/gui/scripts/alerts.js b/gui/scripts/alerts.js index 2f48f6e..5dd8878 100644 --- a/gui/scripts/alerts.js +++ b/gui/scripts/alerts.js @@ -16,13 +16,17 @@ export default class alerts { constructor(TITLE, MESSAGE) { // Set this message's properties. - this.TITLE = TITLE; - this.MESSAGE = MESSAGE; + if (MESSAGE = null) { + this.message = TITLE; + } else { + this.title = TITLE; + this.message = MESSAGE; + } // Display the message. - console.log(TITLE, MESSAGE); + console.log((MESSAGE ? (this.title).concat(`\n`) : ``).concat(this.message)); try { - M.toast({ text: TITLE.concat(`\n`).concat(MESSAGE) }); + M.toast({ text: (MESSAGE ? (this.title).concat(`\n`) : ``).concat(this.message) }); } catch (err) {} }