From 71372fcbc15a8895098546c2f80ccb6b413eac1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marian=20H=C3=A4hnlein?= Date: Fri, 19 Aug 2022 13:11:30 +0200 Subject: [PATCH 1/2] Replace tabs with spaces to maintain consistency --- server/config.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/server/config.js b/server/config.js index 60d3705c..872d946f 100644 --- a/server/config.js +++ b/server/config.js @@ -169,14 +169,14 @@ const conf = convict({ env: 'BASE_URL' }, custom_title: { - format: String, - default: 'Send', - env: 'CUSTOM_TITLE' + format: String, + default: 'Send', + env: 'CUSTOM_TITLE' }, custom_description: { - format: String, - default: 'Encrypt and send files with a link that automatically expires to ensure your important documents don’t stay online forever.', - env: 'CUSTOM_DESCRIPTION' + format: String, + default: 'Encrypt and send files with a link that automatically expires to ensure your important documents don’t stay online forever.', + env: 'CUSTOM_DESCRIPTION' }, detect_base_url: { format: Boolean, @@ -329,11 +329,11 @@ const conf = convict({ default: '', env: 'UI_CUSTOM_ASSETS_WORDMARK' }, - custom_css: { - format: String, - default: '', - env: 'UI_CUSTOM_CSS' - } + custom_css: { + format: String, + default: '', + env: 'UI_CUSTOM_CSS' + } } }); From d081affa382e295e5c0901a52ad5e5cb7f3ab72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marian=20H=C3=A4hnlein?= Date: Fri, 19 Aug 2022 13:17:59 +0200 Subject: [PATCH 2/2] Move injection of custom CSS from client to server --- server/layout.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/server/layout.js b/server/layout.js index 0aceade7..6d2051ab 100644 --- a/server/layout.js +++ b/server/layout.js @@ -3,6 +3,10 @@ const assets = require('../common/assets'); const initScript = require('./initScript'); module.exports = function(state, body = '') { + const custom_css = state.ui.assets.custom_css !== '' + ? html`` + : '' + return html` @@ -40,16 +44,7 @@ module.exports = function(state, body = '') { type="text/css" href="${assets.get('app.css')}" /> - + ${custom_css}