From e1587b2bc1b425a162af30d6c271bcd392047b02 Mon Sep 17 00:00:00 2001
From: Maximilian Hils <git@maximilianhils.com>
Date: Mon, 25 Jul 2016 17:12:39 -0700
Subject: make empty buttons editable

---
 web/src/js/components/ContentView/ContentLoader.jsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'web/src/js/components/ContentView/ContentLoader.jsx')

diff --git a/web/src/js/components/ContentView/ContentLoader.jsx b/web/src/js/components/ContentView/ContentLoader.jsx
index fb022df6..697085a9 100644
--- a/web/src/js/components/ContentView/ContentLoader.jsx
+++ b/web/src/js/components/ContentView/ContentLoader.jsx
@@ -41,6 +41,10 @@ export default View => class extends React.Component {
         if (this.state.request) {
             this.state.request.abort()
         }
+        if(props.message.contentLength === 0 || props.message.contentLength === null){
+            return this.setState({request: undefined, content: ""})
+        }
+
         let requestUrl = MessageUtils.getContentURL(props.flow, props.message)
 
         // We use XMLHttpRequest instead of fetch() because fetch() is not (yet) abortable.
@@ -75,7 +79,7 @@ export default View => class extends React.Component {
     }
 
     render() {
-        return this.state.content ? (
+        return this.state.content !== undefined ? (
             <View content={this.state.content} {...this.props}/>
         ) : (
             <div className="text-center">
-- 
cgit v1.2.3

