From a12b017d2fe53f685c54179fd703441e81cebc9e Mon Sep 17 00:00:00 2001 From: Luke Crouch Date: Wed, 22 May 2019 16:14:41 -0500 Subject: [PATCH] review fixes --- controllers/user.js | 2 +- public/js/dashboard.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/user.js b/controllers/user.js index 6f4b7395f..ec5e8e139 100644 --- a/controllers/user.js +++ b/controllers/user.js @@ -244,7 +244,7 @@ async function getUnsubscribe(req, res) { } const emailAddress = await DB.getEmailByToken(req.query.token); - if (!subscriber && !emailAddress) { + if (!emailAddress) { throw new FluentError("error-not-subscribed"); } diff --git a/public/js/dashboard.js b/public/js/dashboard.js index 724f931e4..32c225bd9 100644 --- a/public/js/dashboard.js +++ b/public/js/dashboard.js @@ -53,8 +53,8 @@ if (document.querySelector(".email-card")) { }); } -if (document.querySelector(".remove-fxm")) { - const removeMonitorButton = document.querySelector(".remove-fxm"); +const removeMonitorButton = document.querySelector(".remove-fxm"); +if (removeMonitorButton) { removeMonitorButton.addEventListener("click", async (e) => { const {formAction, primaryToken, primaryHash} = e.target.dataset; await sendForm(formAction, {primaryToken, primaryHash});