about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/drawer
diff options
context:
space:
mode:
authorkibigo! <marrus-sh@users.noreply.github.com>2017-12-27 14:28:41 -0800
committerkibigo! <marrus-sh@users.noreply.github.com>2018-01-04 18:21:59 -0800
commit8713659dffc884c65376091d3731c8074ac581e4 (patch)
tree2e5ab6d6c1ac7ed5174a80cc798a4dcd33d79951 /app/javascript/flavours/glitch/features/drawer
parent3c29f5740447270a4122b334281a907ecbdd4165 (diff)
WIP <Compose> Refactor; <OnboardingModal> ed.
Diffstat (limited to 'app/javascript/flavours/glitch/features/drawer')
-rw-r--r--app/javascript/flavours/glitch/features/drawer/index.js6
-rw-r--r--app/javascript/flavours/glitch/features/drawer/search/index.js4
2 files changed, 8 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/features/drawer/index.js b/app/javascript/flavours/glitch/features/drawer/index.js
index 01ec18fc5..1b7a8a0b5 100644
--- a/app/javascript/flavours/glitch/features/drawer/index.js
+++ b/app/javascript/flavours/glitch/features/drawer/index.js
@@ -143,6 +143,12 @@ Drawer.propTypes = {
   }).isRequired,
 };
 
+//  Default props.
+Drawer.defaultProps = {
+  dispatch: {},
+  state: {},
+};
+
 //  Connecting and export.
 export { Drawer as WrappedComponent };
 export default wrap(Drawer, mapStateToProps, mapDispatchToProps, true);
diff --git a/app/javascript/flavours/glitch/features/drawer/search/index.js b/app/javascript/flavours/glitch/features/drawer/search/index.js
index ccb2ba859..ed69f71ed 100644
--- a/app/javascript/flavours/glitch/features/drawer/search/index.js
+++ b/app/javascript/flavours/glitch/features/drawer/search/index.js
@@ -109,7 +109,7 @@ export default class DrawerSearch extends React.PureComponent {
           <input
             type='text'
             placeholder={intl.formatMessage(messages.placeholder)}
-            value={value}
+            value={value || ''}
             onChange={change}
             onKeyUp={keyUp}
             onFocus={focus}
@@ -129,7 +129,7 @@ export default class DrawerSearch extends React.PureComponent {
 
         <Overlay
           placement='bottom'
-          show={expanded && !value.length && !submitted}
+          show={expanded && !(value || '').length && !submitted}
           target={this}
         ><DrawerSearchPopout /></Overlay>
       </div>