From 7fe3c9495378e3b0f898a3427aa41110f1a52526 Mon Sep 17 00:00:00 2001 From: Christian Haschek Date: Tue, 8 Feb 2022 00:09:58 +0100 Subject: [PATCH] hiding "generate" button when no domain is configured. closes #38 --- web/api.php | 1 + web/index.html | 2 +- web/js/opentrashmail.js | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/web/api.php b/web/api.php index 34b0085..e9d9f17 100644 --- a/web/api.php +++ b/web/api.php @@ -56,6 +56,7 @@ switch($action) $settings = loadSettings(); if($settings['DOMAINS']) $o = explode(',',$settings['DOMAINS']); + else $o = []; break; case 'attachment': $id = intval($_REQUEST['id']); diff --git a/web/index.html b/web/index.html index a16805d..1bbc98b 100644 --- a/web/index.html +++ b/web/index.html @@ -25,7 +25,7 @@
  - +
diff --git a/web/js/opentrashmail.js b/web/js/opentrashmail.js index ce3acc2..796c970 100644 --- a/web/js/opentrashmail.js +++ b/web/js/opentrashmail.js @@ -12,7 +12,9 @@ $( document ).ready(function() { loadAccount(email) $.get("api.php?a=getdoms",function(data){ - domains = data; + if(data.length>0) + domains = data; + else $("#btn-gen-random").hide(); },"json") });