From 92ec70c4977a49512be74998f5f3b217dc656dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Casaj=C3=BAs?= Date: Tue, 15 Feb 2022 18:50:09 +0100 Subject: [PATCH] Show a warning if the user cannot create more aliases --- templates/dashboard/support.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/dashboard/support.html b/templates/dashboard/support.html index 64cfa9af..58a4eadf 100644 --- a/templates/dashboard/support.html +++ b/templates/dashboard/support.html @@ -72,10 +72,14 @@ }, methods: { generateRandomAlias: async function (event) { - let result = await fetch('/api/alias/random/new', {method: 'POST'}) + let result = await fetch('/api/alias/random/new', {method: 'POST'}); if (result.ok) { let data = await result.json(); this.ticket_email = data.alias; + } else if (result.status === 429 ){ + toastr.warning("You've created too many aliases recently. Wait a bit before creating more"); + } else { + toastr.warning("You can't create more aliases"); } } }