Bugfix not showing post file size on express server .render('d pages

merge-requests/208/head
Thomas Lynch 4 years ago
parent 6657f50e4d
commit 080dc3f660
  1. 2
      helpers/files/formatsize.js
  2. 1
      server.js

@ -4,7 +4,7 @@ const sizes = ['B', 'KB', 'MB', 'GB', 'TB']
, k = 1024;
module.exports = (bytes) => {
if (bytes === 0) {
if (bytes === 0) {
return '0B';
}
const i = Math.floor(Math.log(bytes) / Math.log(k));

@ -75,6 +75,7 @@ const express = require('express')
app.locals.commit = commit;
app.locals.meta = meta;
app.locals.captchaType = captchaOptions.type;
app.locals.postFilesSize = formatSize(globalLimits.postFilesSize.max);
switch (captchaOptions.type) {
case 'google':
app.locals.googleRecaptchaSiteKey = captchaOptions.google.siteKey;

Loading…
Cancel
Save