From 807c0591e177ce8ec70298aabd1df3c89c38e19d Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 1 Sep 2023 15:13:27 +0200 Subject: [PATCH] [Glitch] Fix search popout including full-text search instructions when full-text search is disabled Port 6c4c72497a5722870e4432ef41dd4c9ec36a8928 to glitch-soc Signed-off-by: Claire --- .../features/compose/components/search.jsx | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/app/javascript/flavours/glitch/features/compose/components/search.jsx b/app/javascript/flavours/glitch/features/compose/components/search.jsx index 218518a7b6..e83c1761ec 100644 --- a/app/javascript/flavours/glitch/features/compose/components/search.jsx +++ b/app/javascript/flavours/glitch/features/compose/components/search.jsx @@ -106,7 +106,7 @@ class Search extends PureComponent { handleKeyDown = (e) => { const { selectedOption } = this.state; - const options = this._getOptions().concat(this.defaultOptions); + const options = searchEnabled ? this._getOptions().concat(this.defaultOptions) : this._getOptions(); switch(e.key) { case 'Escape': @@ -362,15 +362,19 @@ class Search extends PureComponent { )} -

+ {searchEnabled && ( + <> +

-
- {this.defaultOptions.map(({ key, label, action }, i) => ( - - ))} -
+
+ {this.defaultOptions.map(({ key, label, action }, i) => ( + + ))} +
+ + )} );