aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-02-08 23:08:13 +0100
committer0neGal <mail@0negal.com>2022-02-08 23:08:13 +0100
commit0813769008f5436e1cea2ad97f1a527c8ce94df7 (patch)
treedee3b5b8bf49f82a187afd1f04faa229b967985d
parentc1153f19e6323bbc76145d3defe0bca6b2b6088e (diff)
downloadViper-0813769008f5436e1cea2ad97f1a527c8ce94df7.tar.gz
Viper-0813769008f5436e1cea2ad97f1a527c8ce94df7.zip
two toasts can now be added at the same time
There used to be an error where if you spawned two toasts simultaneously they'll get the same ID, this fixes that by upping the ID by one if the ID is already taken.
-rw-r--r--src/app/toast.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/app/toast.js b/src/app/toast.js
index 8d78e37..2a8555e 100644
--- a/src/app/toast.js
+++ b/src/app/toast.js
@@ -25,6 +25,7 @@ function Toast(properties) {
let id = Date.now();
+ if (document.getElementById(id)) {id = id + 1}
let el = document.createElement("div");
el.classList.add("toast");