update constructor on message initiing
This commit is contained in:
		
							parent
							
								
									086ca5a8aa
								
							
						
					
					
						commit
						571dc18f34
					
				
					 1 changed files with 8 additions and 4 deletions
				
			
		|  | @ -16,13 +16,17 @@ export default class alerts { | ||||||
| 
 | 
 | ||||||
| 	constructor(TITLE, MESSAGE) { | 	constructor(TITLE, MESSAGE) { | ||||||
| 		// Set this message's properties. 
 | 		// Set this message's properties. 
 | ||||||
| 		this.TITLE = TITLE; | 		if (MESSAGE = null) { | ||||||
| 		this.MESSAGE = MESSAGE; | 			this.message = TITLE; | ||||||
|  | 		} else { | ||||||
|  | 			this.title = TITLE; | ||||||
|  | 			this.message = MESSAGE; | ||||||
|  | 		} | ||||||
| 
 | 
 | ||||||
| 		// Display the message.
 | 		// Display the message.
 | ||||||
| 		console.log(TITLE, MESSAGE); | 		console.log((MESSAGE ? (this.title).concat(`\n`) : ``).concat(this.message)); | ||||||
| 		try { | 		try { | ||||||
| 			M.toast({ text: TITLE.concat(`\n`).concat(MESSAGE) }); | 			M.toast({ text: (MESSAGE ? (this.title).concat(`\n`) : ``).concat(this.message) }); | ||||||
| 		} catch (err) {} | 		} catch (err) {} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue