run eslint pre-hook

This commit is contained in:
Niko Storni 2018-11-10 19:11:12 -05:00 committed by Shawn
parent 959c06746d
commit 7391df8e84
3 changed files with 15 additions and 4 deletions

View file

@ -58,7 +58,11 @@ const autoblockPublishBodyMiddleware = (req, res, next) => {
let ip = (req.headers['x-forwarded-for'] || req.connection.remoteAddress).split(/,\s?/)[0];
const { channelName } = req.body;
<<<<<<< HEAD
if (channelName && publishingChannelWhitelist.indexOf(channelName.toLowerCase()) !== -1) {
=======
if (channelName && publishingChannelWhitelist.indexOf(channelName) !== -1) {
>>>>>>> run eslint pre-hook
delete ipCounts[ip];
}
}

View file

@ -27,7 +27,11 @@ function logMetricsMiddleware (req, res, next) {
db.Metrics.create({
time : Date.now(),
<<<<<<< HEAD
isInternal: /node-fetch/.test(userAgent),
=======
isInternal: /node\-fetch/.test(userAgent),
>>>>>>> run eslint pre-hook
isChannel : res.isChannel,
claimId : res.claimId,
routePath : httpContext.get('routePath'),

View file

@ -53,20 +53,23 @@ module.exports = (req, res) => {
const runSaga = (action !== false && saga !== false);
const renderPage = (store) => {
// Workaround, remove when a solution for async httpContext exists
const showState = store.getState().show;
const assetKeys = Object.keys(showState.assetList);
<<<<<<< HEAD
if(assetKeys.length !== 0) {
=======
if (assetKeys.length !== 0) {
>>>>>>> run eslint pre-hook
res.claimId = showState.assetList[assetKeys[0]].claimId;
} else {
const channelKeys = Object.keys(showState.channelList);
if(channelKeys.length !== 0) {
if (channelKeys.length !== 0) {
res.claimId = showState.channelList[channelKeys[0]].longId;
res.isChannel = true;
}
}
}
// render component to a string
@ -119,7 +122,7 @@ module.exports = (req, res) => {
console.log(`redirecting ${req.originalUrl} to ${canonicalUrl}`);
res.redirect(canonicalUrl);
}
return renderPage(store)
return renderPage(store);
});
} else {
const store = createStore(Reducers);