diff --git a/app/views/RoomView/index.tsx b/app/views/RoomView/index.tsx index 0e6f2d4e..586c9dde 100644 --- a/app/views/RoomView/index.tsx +++ b/app/views/RoomView/index.tsx @@ -785,13 +785,22 @@ class RoomView extends React.Component { }); }; + handleCloseEmoji = (action?: Function, params?: any) => { + if (this.messagebox?.current) { + return this.messagebox?.current.closeEmojiAndAction(action, params); + } + if (action) { + return action(params); + } + }; + errorActionsShow = (message: TAnyMessageModel) => { - this.messagebox?.current?.closeEmojiAndAction(this.messageErrorActions?.showMessageErrorActions, message); + this.handleCloseEmoji(this.messageErrorActions?.showMessageErrorActions, message); }; showActionSheet = (options: any) => { const { showActionSheet } = this.props; - this.messagebox?.current?.closeEmojiAndAction(showActionSheet, options); + this.handleCloseEmoji(showActionSheet, options); }; onEditInit = (message: TAnyMessageModel) => { @@ -850,7 +859,7 @@ class RoomView extends React.Component { }; onReactionInit = (message: TAnyMessageModel) => { - this.messagebox?.current?.closeEmojiAndAction(() => { + this.handleCloseEmoji(() => { this.setState({ selectedMessage: message }, this.showReactionPicker); }); }; @@ -865,7 +874,7 @@ class RoomView extends React.Component { if (message.tmid && !this.tmid) { return; } - this.messagebox?.current?.closeEmojiAndAction(this.messageActions?.showMessageActions, message); + this.handleCloseEmoji(this.messageActions?.showMessageActions, message); }; showAttachment = (attachment: IAttachment) => { @@ -894,7 +903,7 @@ class RoomView extends React.Component { this.setState({ selectedMessage: message }); const { showActionSheet } = this.props; const { selectedMessage } = this.state; - this.messagebox?.current?.closeEmojiAndAction(showActionSheet, { + this.handleCloseEmoji(showActionSheet, { children: , snaps: ['50%', '80%'], enableContentPanningGesture: false @@ -1380,7 +1389,7 @@ class RoomView extends React.Component { jumpToMessage={this.jumpToMessageByUrl} highlighted={highlightedMessage === item.id} theme={theme} - closeEmojiAndAction={this.messagebox?.current?.closeEmojiAndAction} + closeEmojiAndAction={this.handleCloseEmoji} /> ); }