I have the following snippet of ion display code for displaying alarms / errors in an industrial application:
showError(message: string) {
let toast = this.toastController.create({
message: message,
position: 'top',
duration: 5000,
cssClass: 'danger',
showCloseButton: true
});
toast.present();
}
The application launches an error message every time it detects a connection problem, which will also be around a 5-second timer.
Several calls to this method will result in 2 or more error messages displayed on top of each other if the time of this code is changed. Can I somehow find out that the toast is already displayed? In addition, a 5000 ms timer is not needed, and I can simply delete the error message again when the connection is restored.
Thanks and BR Florian
source
share