about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/composer/options/index.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-08-22 15:58:57 +0200
committerThibG <thib@sitedethib.com>2018-08-29 14:29:36 +0200
commit171e54eb469ac48830eba2349b3298c004ec19f5 (patch)
treeac71fec646a6faecd0297d38f2d586101a9a57ae /app/javascript/flavours/glitch/features/composer/options/index.js
parent1b479f08c56f2a4c291ccfffcb8e1217f0ca3686 (diff)
Add opt-in feature to have the spoilers field always on (fixes #634)
Diffstat (limited to 'app/javascript/flavours/glitch/features/composer/options/index.js')
-rw-r--r--app/javascript/flavours/glitch/features/composer/options/index.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/app/javascript/flavours/glitch/features/composer/options/index.js b/app/javascript/flavours/glitch/features/composer/options/index.js
index c129622bc..05cbe24c9 100644
--- a/app/javascript/flavours/glitch/features/composer/options/index.js
+++ b/app/javascript/flavours/glitch/features/composer/options/index.js
@@ -285,13 +285,15 @@ export default class ComposerOptions extends React.PureComponent {
           title={intl.formatMessage(messages.change_privacy)}
           value={privacy}
         />
-        <TextIconButton
-          active={spoiler}
-          ariaControls='glitch.composer.spoiler.input'
-          label='CW'
-          onClick={onToggleSpoiler}
-          title={intl.formatMessage(messages.spoiler)}
-        />
+        {onToggleSpoiler && (
+          <TextIconButton
+            active={spoiler}
+            ariaControls='glitch.composer.spoiler.input'
+            label='CW'
+            onClick={onToggleSpoiler}
+            title={intl.formatMessage(messages.spoiler)}
+          />
+        )}
         <Dropdown
           active={advancedOptions && advancedOptions.some(value => !!value)}
           disabled={disabled}