clean up EventTile:onWidgetLoad optional/required mess

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2018-05-01 18:15:12 +01:00
parent db55f87699
commit ec4ec4717d
No known key found for this signature in database
GPG Key ID: 3F879DA5AD802A5E
2 changed files with 5 additions and 3 deletions

View File

@ -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.

View File

@ -75,11 +75,8 @@ export default class ReplyPreview extends React.Component {
<EventTile last={true}
tileShape="reply_preview"
mxEvent={this.state.event}
onWidgetLoad={dummyOnWidgetLoad}
isTwelveHour={SettingsStore.getValue("showTwelveHourTimestamps")} />
</div>
</div>;
}
}
function dummyOnWidgetLoad() {}