diff options
Diffstat (limited to 'src/lib/utils.js')
| -rw-r--r-- | src/lib/utils.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/utils.js b/src/lib/utils.js index 738413bf..4ffbb8b0 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -101,7 +101,11 @@ export function reverseFormat(val, locale) { export let protectedRoutes = [/customers/, /settings/, /payments/]; +let recent = []; export let success = (m, clear = true) => { + if (recent.includes(m)) return; + recent.push(m); + setTimeout(() => (recent = []), 5000); if (clear) toast.pop(); toast.push(m, { theme: { @@ -110,7 +114,7 @@ export let success = (m, clear = true) => { }); }; -export let warning = (m, clear = true) => { + export let warning = (m, clear = true) => { if (clear) toast.pop(); toast.push(m, { theme: { |
