Skip to content

Commit

Permalink
Revised handlebars boolean variables to be more succinct.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxxcrawford committed Apr 1, 2020
1 parent d489c0b commit b46b979
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions controllers/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ async function home(req, res) {
const coinFlipNumber = Math.random() * 100;
const experimentBranch = getExperimentBranch(req, coinFlipNumber);

const isUserInExperiment = isExperiment(experimentBranch);
let experimentBranchB = false;
if (experimentBranch === "vb" && isUserInExperiment) {
experimentBranchB = true;
}
const isUserInExperiment = (experimentBranch === "vb" || experimentBranch === "vc");
const experimentBranchB = (experimentBranch === "vb" && isUserInExperiment);

let featuredBreach = null;
let scanFeaturedBreach = false;
Expand Down Expand Up @@ -67,11 +64,6 @@ async function home(req, res) {
});
}

function isExperiment(experimentBranch) {
if (experimentBranch === "vb" || experimentBranch === "vc") { return true; }
return false;
}

function getExperimentBranch(req, sorterNum) {

if (!req.headers["accept-language"].includes("en") ){
Expand Down

0 comments on commit b46b979

Please sign in to comment.