about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-10-12 23:12:39 +0200
committerThibG <thib@sitedethib.com>2018-10-12 23:34:26 +0200
commit70d346ea951ebfa002225759310d72882a435a5c (patch)
treefa74d29ac9960c2d64d9b1719277bd6b4e52d0b9 /app/javascript
parent3d5d899094ecf389ce6cf31a6f33dcf1894e662d (diff)
Fix auto-unfold CWs when no regexp is set
Fixes #778
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/flavours/glitch/util/content_warning.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/util/content_warning.js b/app/javascript/flavours/glitch/util/content_warning.js
index 29e221c8e..5e874a49c 100644
--- a/app/javascript/flavours/glitch/util/content_warning.js
+++ b/app/javascript/flavours/glitch/util/content_warning.js
@@ -4,6 +4,11 @@ export function autoUnfoldCW (settings, status) {
   }
 
   const rawRegex = settings.getIn(['content_warnings', 'filter']);
+
+  if (!rawRegex) {
+    return true;
+  }
+
   let regex      = null;
 
   try {