From 7cb2847b944f6d1b1530b9bdf83df4ccca63a158 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Thu, 30 Aug 2018 19:35:03 -0400 Subject: [PATCH] fix error with undefined env S3_URL_BUCKER_BASE --- client/modules/IDE/actions/uploader.js | 8 ++++---- server/views/index.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/modules/IDE/actions/uploader.js b/client/modules/IDE/actions/uploader.js index 913f3aa9..a15d32d7 100644 --- a/client/modules/IDE/actions/uploader.js +++ b/client/modules/IDE/actions/uploader.js @@ -59,10 +59,10 @@ export function dropzoneAcceptCallback(userId, file, done) { } ) .then((response) => { - file.custom_status = 'ready'; // eslint-disable-line - file.postData = response.data; // eslint-disable-line - file.s3 = response.data.key; // eslint-disable-line - file.previewTemplate.className += ' uploading'; // eslint-disable-line + file.custom_status = 'ready'; // eslint-disable-line + file.postData = response.data; // eslint-disable-line + file.s3 = response.data.key; // eslint-disable-line + file.previewTemplate.className += ' uploading'; // eslint-disable-line done(); }) .catch((response) => { diff --git a/server/views/index.js b/server/views/index.js index 213778f5..7e9a0e2c 100644 --- a/server/views/index.js +++ b/server/views/index.js @@ -25,7 +25,7 @@ export function renderIndex() { window.process.env.API_URL = '${process.env.API_URL}'; window.process.env.NODE_ENV = '${process.env.NODE_ENV}'; window.process.env.S3_BUCKET = '${process.env.S3_BUCKET}'; - window.process.env.S3_BUCKET_URL_BASE = '${process.env.S3_BUCKET_URL_BASE}'; + window.process.env.S3_BUCKET_URL_BASE = ${process.env.S3_BUCKET_URL_BASE ? `'${process.env.S3_BUCKET_URL_BASE}'` : undefined}; window.process.env.AWS_REGION = '${process.env.AWS_REGION}'; window.process.env.FORCE_TO_HTTPS = ${process.env.FORCE_TO_HTTPS === 'false' ? false : undefined}; window.process.env.CLIENT = true;