From 9d617409ed7ccc3eed752507daee2ed569cf3ad0 Mon Sep 17 00:00:00 2001 From: Natalie Carey Date: Mon, 30 Jan 2023 16:09:19 +0000 Subject: [PATCH] Cleaning up ternary to improve readability. --- lib/manage-prototype-handlers.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/manage-prototype-handlers.js b/lib/manage-prototype-handlers.js index 95e43aac61..19587d98bb 100644 --- a/lib/manage-prototype-handlers.js +++ b/lib/manage-prototype-handlers.js @@ -518,15 +518,16 @@ async function getPluginsModeHandler (req, res) { const pageName = `${verb.title} ${chosenPlugin.name}` - const returnLink = req.query.returnTo === 'templates' - ? { - href: '/manage-prototype/templates', - text: 'Back to templates' - } - : { - href: '/manage-prototype/plugins', - text: 'Back to plugins' - } + const templatesReturnLink = { + href: '/manage-prototype/templates', + text: 'Back to templates' + } + const pluginsReturnLink = { + href: '/manage-prototype/plugins', + text: 'Back to plugins' + } + + const returnLink = req.query.returnTo === 'templates' ? templatesReturnLink : pluginsReturnLink res.render(getManagementView('plugin-install-or-uninstall.njk'), { currentPage: pageName,