From afe4ad7e3d757ed93dc1f391b674d92c105e4e68 Mon Sep 17 00:00:00 2001
From: Diego Mello <diegolmello@gmail.com>
Date: Wed, 30 Jan 2019 11:33:48 -0200
Subject: [PATCH] [FIX] Back button press on message actions (#592)

---
 app/containers/MessageActions.js | 70 ++++++++++++++++----------------
 1 file changed, 36 insertions(+), 34 deletions(-)

diff --git a/app/containers/MessageActions.js b/app/containers/MessageActions.js
index 2527d052b..b38fb750e 100644
--- a/app/containers/MessageActions.js
+++ b/app/containers/MessageActions.js
@@ -295,41 +295,43 @@ export default class MessageActions extends React.Component {
 	}
 
 	handleActionPress = (actionIndex) => {
-		const { actionsHide } = this.props;
-		switch (actionIndex) {
-			case this.REPLY_INDEX:
-				this.handleReply();
-				break;
-			case this.EDIT_INDEX:
-				this.handleEdit();
-				break;
-			case this.PERMALINK_INDEX:
-				this.handlePermalink();
-				break;
-			case this.COPY_INDEX:
-				this.handleCopy();
-				break;
-			case this.SHARE_INDEX:
-				this.handleShare();
-				break;
-			case this.QUOTE_INDEX:
-				this.handleQuote();
-				break;
-			case this.STAR_INDEX:
-				this.handleStar();
-				break;
-			case this.PIN_INDEX:
-				this.handlePin();
-				break;
-			case this.REACTION_INDEX:
-				this.handleReaction();
-				break;
-			case this.DELETE_INDEX:
-				this.handleDelete();
-				break;
-			default:
-				break;
+		if (actionIndex) {
+			switch (actionIndex) {
+				case this.REPLY_INDEX:
+					this.handleReply();
+					break;
+				case this.EDIT_INDEX:
+					this.handleEdit();
+					break;
+				case this.PERMALINK_INDEX:
+					this.handlePermalink();
+					break;
+				case this.COPY_INDEX:
+					this.handleCopy();
+					break;
+				case this.SHARE_INDEX:
+					this.handleShare();
+					break;
+				case this.QUOTE_INDEX:
+					this.handleQuote();
+					break;
+				case this.STAR_INDEX:
+					this.handleStar();
+					break;
+				case this.PIN_INDEX:
+					this.handlePin();
+					break;
+				case this.REACTION_INDEX:
+					this.handleReaction();
+					break;
+				case this.DELETE_INDEX:
+					this.handleDelete();
+					break;
+				default:
+					break;
+			}
 		}
+		const { actionsHide } = this.props;
 		actionsHide();
 	}
 
-- 
GitLab