about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/composer/textarea/suggestions
diff options
context:
space:
mode:
authorkibigo! <marrus-sh@users.noreply.github.com>2018-01-03 12:36:21 -0800
committerkibigo! <marrus-sh@users.noreply.github.com>2018-01-04 18:33:13 -0800
commit42f50049ff29ccdc484c22f8a5a19cda2dd03a5b (patch)
tree5e04c0bc0106f634316202eb8dc2f8c356d1b556 /app/javascript/flavours/glitch/features/composer/textarea/suggestions
parentb4a3792201ccc01713b536e50428e027bd094d2b (diff)
WIP <Compose> Refactor; 1000 tiny edits
Diffstat (limited to 'app/javascript/flavours/glitch/features/composer/textarea/suggestions')
-rw-r--r--app/javascript/flavours/glitch/features/composer/textarea/suggestions/index.js6
-rw-r--r--app/javascript/flavours/glitch/features/composer/textarea/suggestions/item/index.js6
2 files changed, 6 insertions, 6 deletions
diff --git a/app/javascript/flavours/glitch/features/composer/textarea/suggestions/index.js b/app/javascript/flavours/glitch/features/composer/textarea/suggestions/index.js
index 65ed2c18a..dc72585f2 100644
--- a/app/javascript/flavours/glitch/features/composer/textarea/suggestions/index.js
+++ b/app/javascript/flavours/glitch/features/composer/textarea/suggestions/index.js
@@ -18,9 +18,9 @@ export default function ComposerTextareaSuggestions ({
   return (
     <div
       className='composer--textarea--suggestions'
-      hidden={hidden || suggestions.isEmpty()}
+      hidden={hidden || !suggestions || suggestions.isEmpty()}
     >
-      {!hidden ? suggestions.map(
+      {!hidden && suggestions ? suggestions.map(
         (suggestion, index) => (
           <ComposerTextareaSuggestionsItem
             index={index}
@@ -39,5 +39,5 @@ ComposerTextareaSuggestions.propTypes = {
   hidden: PropTypes.bool,
   onSuggestionClick: PropTypes.func,
   suggestions: ImmutablePropTypes.list,
-  value: PropTypes.string,
+  value: PropTypes.number,
 };
diff --git a/app/javascript/flavours/glitch/features/composer/textarea/suggestions/item/index.js b/app/javascript/flavours/glitch/features/composer/textarea/suggestions/item/index.js
index b78f99ee9..dc057e679 100644
--- a/app/javascript/flavours/glitch/features/composer/textarea/suggestions/item/index.js
+++ b/app/javascript/flavours/glitch/features/composer/textarea/suggestions/item/index.js
@@ -17,7 +17,7 @@ const assetHost = ((process || {}).env || {}).CDN_HOST || '';
 const handlers = {
 
   //  Handles a click on a suggestion.
-  click (e) {
+  handleClick (e) {
     const {
       index,
       onClick,
@@ -40,7 +40,7 @@ export default class ComposerTextareaSuggestionsItem extends React.Component {
 
   //  Rendering.
   render () {
-    const { click } = this.handlers;
+    const { handleClick } = this.handlers;
     const {
       selected,
       suggestion,
@@ -51,7 +51,7 @@ export default class ComposerTextareaSuggestionsItem extends React.Component {
     return (
       <div
         className={computedClass}
-        onMouseDown={click}
+        onMouseDown={handleClick}
         role='button'
         tabIndex='0'
       >