Merge pull request #2944 from overleaf/as-clean-up-home-controller

Remove unnecessary check for SL homepage

GitOrigin-RevId: 3173ddd682458f36e11c77d8644500b8ce8af1cb
This commit is contained in:
Alasdair Smith 2020-06-23 09:45:07 +01:00 committed by Copybot
parent beb452e4e0
commit 5636386c54

View file

@ -14,9 +14,6 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
let HomeController
const logger = require('logger-sharelatex')
const Settings = require('settings-sharelatex')
const _ = require('underscore')
const Features = require('../../infrastructure/Features')
const Path = require('path')
@ -25,10 +22,7 @@ const fs = require('fs')
const ErrorController = require('../Errors/ErrorController')
const AuthenticationController = require('../Authentication/AuthenticationController')
const slHomepageExists = fs.existsSync(
Path.resolve(__dirname + '/../../../views/external/home/sl.pug')
)
const v2HomepageExists = fs.existsSync(
const homepageExists = fs.existsSync(
Path.resolve(__dirname + '/../../../views/external/home/v2.pug')
)
@ -46,17 +40,7 @@ module.exports = HomeController = {
},
home(req, res, next) {
if (
Features.hasFeature('homepage') &&
!Settings.overleaf &&
slHomepageExists
) {
return res.render('external/home/sl')
} else if (
Features.hasFeature('homepage') &&
Settings.overleaf &&
v2HomepageExists
) {
if (Features.hasFeature('homepage') && homepageExists) {
return res.render('external/home/v2')
} else {
return res.redirect('/login')