From 29d271cc618273b5a218dd373222017b021f69d5 Mon Sep 17 00:00:00 2001 From: Taras Perun Date: Wed, 8 Mar 2023 19:08:32 +0100 Subject: [PATCH 1/4] fix preferredEmojiSkinTone --- src/libs/actions/Report.js | 2 +- src/setup/index.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index afd6692d7d40..c4549b6cc121 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -42,7 +42,7 @@ Onyx.connect({ callback: (val) => { // the preferred skin tone is sometimes still "default", although it // was changed that "default" has become -1. - if (Number.isInteger(Number(val))) { + if (!_.isNull(val) && Number.isInteger(Number(val))) { preferredSkinTone = val; } else { preferredSkinTone = -1; diff --git a/src/setup/index.js b/src/setup/index.js index b2fea9a98ad8..9641101a7f56 100644 --- a/src/setup/index.js +++ b/src/setup/index.js @@ -39,6 +39,7 @@ export default function () { }, [ONYXKEYS.IS_SIDEBAR_LOADED]: false, [ONYXKEYS.SHOULD_SHOW_COMPOSE_INPUT]: true, + [ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE]: -1, }, }); From cb4fc3b73f2f357900dff8eac1220edf1bb55f52 Mon Sep 17 00:00:00 2001 From: Taras Perun Date: Wed, 8 Mar 2023 19:08:58 +0100 Subject: [PATCH 2/4] fixed the error when putting the reaction directly on the link --- src/pages/home/report/ContextMenu/ContextMenuActions.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.js b/src/pages/home/report/ContextMenu/ContextMenuActions.js index ddf803050dd3..57dc76f233b1 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.js +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.js @@ -73,6 +73,11 @@ export default [ ); } + const hasMessage = _.has(reportAction, 'message'); + if (!hasMessage) { + // It happens when we long-press on a link. We can only provide a reaction for messages + return null; + } return ( Date: Wed, 8 Mar 2023 21:55:24 +0100 Subject: [PATCH 3/4] update shouldShow --- src/pages/home/report/ContextMenu/ContextMenuActions.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.js b/src/pages/home/report/ContextMenu/ContextMenuActions.js index 57dc76f233b1..cab49dcc3c9c 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.js +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.js @@ -40,7 +40,7 @@ const CONTEXT_MENU_TYPES = { export default [ { shouldKeepOpen: true, - shouldShow: (type, reportAction) => reportAction.actionName !== CONST.REPORT.ACTIONS.TYPE.IOU, + shouldShow: (type, reportAction) => type === CONTEXT_MENU_TYPES.REPORT_ACTION && _.has(reportAction, 'message') && reportAction.actionName !== CONST.REPORT.ACTIONS.TYPE.IOU, renderContent: (closePopover, { reportID, reportAction, close: closeManually, openContextMenu, }) => { @@ -73,11 +73,6 @@ export default [ ); } - const hasMessage = _.has(reportAction, 'message'); - if (!hasMessage) { - // It happens when we long-press on a link. We can only provide a reaction for messages - return null; - } return ( Date: Wed, 8 Mar 2023 21:59:05 +0100 Subject: [PATCH 4/4] remove default value --- src/setup/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/setup/index.js b/src/setup/index.js index 9641101a7f56..b2fea9a98ad8 100644 --- a/src/setup/index.js +++ b/src/setup/index.js @@ -39,7 +39,6 @@ export default function () { }, [ONYXKEYS.IS_SIDEBAR_LOADED]: false, [ONYXKEYS.SHOULD_SHOW_COMPOSE_INPUT]: true, - [ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE]: -1, }, });