Skip to content

Commit

Permalink
Cleaning up ternary to improve readability.
Browse files Browse the repository at this point in the history
  • Loading branch information
nataliecarey committed Jan 30, 2023
1 parent 0a31baf commit 9d61740
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lib/manage-prototype-handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9d61740

Please sign in to comment.