From ec4ec4717df240fe68df270368332e328a5c6e4f Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 1 May 2018 18:15:12 +0100 Subject: [PATCH] clean up EventTile:onWidgetLoad optional/required mess Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/EventTile.js | 5 +++++ src/components/views/rooms/ReplyPreview.js | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index 56ac082f2a..c2e51d878b 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -154,6 +154,11 @@ module.exports = withMatrixClient(React.createClass({ isTwelveHour: PropTypes.bool, }, + defaultProps: { + // no-op function because onWidgetLoad is optional yet some subcomponents assume its existence + onWidgetLoad: function() {}, + }, + getInitialState: function() { return { // Whether the context menu is being displayed. diff --git a/src/components/views/rooms/ReplyPreview.js b/src/components/views/rooms/ReplyPreview.js index dd11b0df33..46e2826634 100644 --- a/src/components/views/rooms/ReplyPreview.js +++ b/src/components/views/rooms/ReplyPreview.js @@ -75,11 +75,8 @@ export default class ReplyPreview extends React.Component { ; } } - -function dummyOnWidgetLoad() {}