From 05a4c19ae1f2b942b602efdfc3f1e8afb8d0fa73 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Fri, 19 Jan 2024 11:18:08 +0700 Subject: [PATCH 1/2] fixlogic clear status and save status --- .../EmojiPicker/EmojiPickerButtonDropdown.js | 7 ++++++- src/pages/settings/Profile/CustomStatus/StatusPage.js | 10 ++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/EmojiPicker/EmojiPickerButtonDropdown.js b/src/components/EmojiPicker/EmojiPickerButtonDropdown.js index bfcb66aeefbb..7f60b0615785 100644 --- a/src/components/EmojiPicker/EmojiPickerButtonDropdown.js +++ b/src/components/EmojiPicker/EmojiPickerButtonDropdown.js @@ -60,7 +60,12 @@ function EmojiPickerButtonDropdown(props) { style={styles.emojiPickerButtonDropdownIcon} numberOfLines={1} > - {props.value} + {props.value || ( + + )} { @@ -79,10 +79,9 @@ function StatusPage({draftStatus, currentUserPersonalDetails}) { setBrickRoadIndicator(isValidClearAfterDate() ? null : CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR); return; } - User.updateCustomStatus({ text: statusText, - emojiCode, + emojiCode: emojiCode || initialEmoji, clearAfter: clearAfterTime !== CONST.CUSTOM_STATUS_TYPES.NEVER ? clearAfterTime : '', }); @@ -101,7 +100,10 @@ function StatusPage({draftStatus, currentUserPersonalDetails}) { emojiCode: '', clearAfter: DateUtils.getEndOfToday(), }); - formRef.current.resetForm({[INPUT_IDS.EMOJI_CODE]: initialEmoji}); + formRef.current.resetForm({[INPUT_IDS.EMOJI_CODE]: ''}); + InteractionManager.runAfterInteractions(() => { + navigateBackToPreviousScreen(); + }); }; useEffect(() => setBrickRoadIndicator(isValidClearAfterDate() ? null : CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR), [isValidClearAfterDate]); From 3f0be39c85ccf69ddac9fc3a24d6637ab70ff872 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Wed, 24 Jan 2024 10:38:08 +0700 Subject: [PATCH 2/2] fix logic clear status --- src/pages/settings/Profile/CustomStatus/StatusPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/settings/Profile/CustomStatus/StatusPage.js b/src/pages/settings/Profile/CustomStatus/StatusPage.js index 7ca13b96ea08..8d649af68001 100644 --- a/src/pages/settings/Profile/CustomStatus/StatusPage.js +++ b/src/pages/settings/Profile/CustomStatus/StatusPage.js @@ -81,7 +81,7 @@ function StatusPage({draftStatus, currentUserPersonalDetails}) { } User.updateCustomStatus({ text: statusText, - emojiCode: emojiCode || initialEmoji, + emojiCode: !emojiCode && statusText ? initialEmoji : emojiCode, clearAfter: clearAfterTime !== CONST.CUSTOM_STATUS_TYPES.NEVER ? clearAfterTime : '', });