diff --git a/android/app/build.gradle b/android/app/build.gradle
index 564e0d319c2d..7391a137145e 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -106,8 +106,13 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
+<<<<<<< HEAD
versionCode 1001033907
versionName "1.3.39-7"
+=======
+ versionCode 1001033905
+ versionName "1.3.39-5"
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
}
splits {
diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist
index 2d38b19002c5..7fe21cdfcf7c 100644
--- a/ios/NewExpensify/Info.plist
+++ b/ios/NewExpensify/Info.plist
@@ -32,7 +32,11 @@
CFBundleVersion
+<<<<<<< HEAD
1.3.39.7
+=======
+ 1.3.39.5
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
ITSAppUsesNonExemptEncryption
LSApplicationQueriesSchemes
diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist
index 6209ce1cca32..7fee760d4dc4 100644
--- a/ios/NewExpensifyTests/Info.plist
+++ b/ios/NewExpensifyTests/Info.plist
@@ -19,6 +19,10 @@
CFBundleSignature
????
CFBundleVersion
+<<<<<<< HEAD
1.3.39.7
+=======
+ 1.3.39.5
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
diff --git a/package-lock.json b/package-lock.json
index 8fe8a0accd0a..b6f05d119813 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,20 @@
{
"name": "new.expensify",
+<<<<<<< HEAD
"version": "1.3.39-7",
+=======
+ "version": "1.3.39-5",
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "new.expensify",
+<<<<<<< HEAD
"version": "1.3.39-7",
+=======
+ "version": "1.3.39-5",
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
diff --git a/package.json b/package.json
index 92086a9f2173..552b61dd8493 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,10 @@
{
"name": "new.expensify",
+<<<<<<< HEAD
"version": "1.3.39-7",
+=======
+ "version": "1.3.39-5",
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
diff --git a/src/components/ReportActionItem/ReportPreview.js b/src/components/ReportActionItem/ReportPreview.js
index c6aea508e409..70279497a0f8 100644
--- a/src/components/ReportActionItem/ReportPreview.js
+++ b/src/components/ReportActionItem/ReportPreview.js
@@ -104,7 +104,11 @@ function ReportPreview(props) {
accessibilityRole="button"
accessibilityLabel={props.translate('iou.viewDetails')}
>
+<<<<<<< HEAD
+=======
+
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
diff --git a/src/components/UserDetailsTooltip/index.web.js b/src/components/UserDetailsTooltip/index.web.js
index 998ea95d3218..23acb453e082 100644
--- a/src/components/UserDetailsTooltip/index.web.js
+++ b/src/components/UserDetailsTooltip/index.web.js
@@ -51,7 +51,11 @@ function UserDetailsTooltip(props) {
/>
{title}
+<<<<<<< HEAD
{subtitle}
+=======
+ {subtitle}
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
),
[props.icon, userAvatar, userAccountID, userLogin, title, subtitle],
diff --git a/src/languages/en.js b/src/languages/en.js
index a47074925c0c..a4de2f379165 100755
--- a/src/languages/en.js
+++ b/src/languages/en.js
@@ -567,7 +567,11 @@ export default {
},
twoFactorAuthForm: {
error: {
+<<<<<<< HEAD
pleaseFillTwoFactorAuth: 'Please enter your two-factor code',
+=======
+ pleaseFillTwoFactorAuth: 'Please enter your two-factor authentication code',
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
incorrect2fa: 'Incorrect two-factor authentication code. Please try again.',
},
},
@@ -712,7 +716,11 @@ export default {
error: {
pleaseFillMagicCode: 'Please enter your magic code',
incorrectMagicCode: 'Incorrect magic code.',
+<<<<<<< HEAD
pleaseFillTwoFactorAuth: 'Please enter your two-factor code',
+=======
+ pleaseFillTwoFactorAuth: 'Please enter your two-factor authentication code',
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
},
},
passwordForm: {
@@ -1294,6 +1302,10 @@ export default {
completed: 'completed task',
canceled: 'canceled task',
reopened: 'reopened task',
+<<<<<<< HEAD
+=======
+ error: 'You do not have the permission to do the requested action.',
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
},
markAsDone: 'Mark as done',
markAsIncomplete: 'Mark as incomplete',
diff --git a/src/languages/es.js b/src/languages/es.js
index e81ad55dc1d8..8c0f22782014 100644
--- a/src/languages/es.js
+++ b/src/languages/es.js
@@ -568,7 +568,11 @@ export default {
},
twoFactorAuthForm: {
error: {
+<<<<<<< HEAD
pleaseFillTwoFactorAuth: 'Por favor, introduce tu código 2 factores',
+=======
+ pleaseFillTwoFactorAuth: 'Por favor, introduce tu código de autenticación de dos factores',
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
incorrect2fa: 'Código de autenticación de dos factores incorrecto. Por favor, inténtalo de nuevo',
},
},
@@ -714,7 +718,11 @@ export default {
error: {
pleaseFillMagicCode: 'Por favor, introduce el código mágico',
incorrectMagicCode: 'Código mágico incorrecto.',
+<<<<<<< HEAD
pleaseFillTwoFactorAuth: 'Por favor, introduce tu código 2 factores',
+=======
+ pleaseFillTwoFactorAuth: 'Por favor, introduce tu código de autenticación de dos factores',
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
},
},
passwordForm: {
@@ -1302,7 +1310,12 @@ export default {
messages: {
completed: 'tarea completada',
canceled: 'tarea cancelada',
+<<<<<<< HEAD
reopened: 'tarea reabierta',
+=======
+ reopened: 'tarea reabrir',
+ error: 'No tiene permiso para realizar la acción solicitada.',
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
},
markAsDone: 'Marcar como completada',
markAsIncomplete: 'Marcar como incompleta',
diff --git a/src/libs/EmojiUtils.js b/src/libs/EmojiUtils.js
index 25a9ef630acc..f6a9d561283f 100644
--- a/src/libs/EmojiUtils.js
+++ b/src/libs/EmojiUtils.js
@@ -14,7 +14,11 @@ Onyx.connect({
frequentlyUsedEmojis = _.map(val, (item) => {
const emoji = Emojis.emojiCodeTable[item.code];
if (emoji) {
+<<<<<<< HEAD
return {name: emoji.name, code: emoji.code, count: item.count, lastUpdatedAt: item.lastUpdatedAt};
+=======
+ return {...emoji, count: item.count, lastUpdatedAt: item.lastUpdatedAt};
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
}
});
},
@@ -228,8 +232,12 @@ function getFrequentlyUsedEmojis(newEmoji) {
frequentEmojiList.splice(emojiIndex, 1);
}
+<<<<<<< HEAD
const {name, code} = Emojis.emojiCodeTable[emoji.code];
const updatedEmoji = {name, code, count: currentEmojiCount, lastUpdatedAt: currentTimestamp};
+=======
+ const updatedEmoji = {...Emojis.emojiCodeTable[emoji.code], count: currentEmojiCount, lastUpdatedAt: currentTimestamp};
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
// We want to make sure the current emoji is added to the list
// Hence, we take one less than the current frequent used emojis
diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js
index 00b8753a405f..23ecbd3c8a16 100644
--- a/src/libs/ReportUtils.js
+++ b/src/libs/ReportUtils.js
@@ -1081,10 +1081,17 @@ function getTransactionReportName(reportAction) {
* Get money request message for an IOU report
*
* @param {Object} report
+<<<<<<< HEAD
* @param {Object} reportAction
* @returns {String}
*/
function getReportPreviewMessage(report, reportAction) {
+=======
+ * @param {Object} [reportAction={}]
+ * @returns {String}
+ */
+function getReportPreviewMessage(report, reportAction = {}) {
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
const reportActionMessage = lodashGet(reportAction, 'message[0].html', '');
if (_.isEmpty(report) || !report.reportID) {
@@ -1561,6 +1568,7 @@ function buildOptimisticIOUReportAction(type, amount, currency, comment, partici
};
}
+<<<<<<< HEAD
function buildOptimisticReportPreview(reportID, iouReportID, payeeAccountID) {
return {
reportActionID: NumberUtils.rand64(),
@@ -1573,14 +1581,36 @@ function buildOptimisticReportPreview(reportID, iouReportID, payeeAccountID) {
{
html: '',
text: '',
+=======
+function buildOptimisticReportPreview(chatReport, iouReport) {
+ const message = getReportPreviewMessage(iouReport);
+ return {
+ reportActionID: NumberUtils.rand64(),
+ reportID: chatReport.reportID,
+ actionName: CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW,
+ pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD,
+ originalMessage: {
+ linkedReportID: iouReport.reportID,
+ },
+ message: [
+ {
+ html: message,
+ text: message,
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
isEdited: false,
type: CONST.REPORT.MESSAGE.TYPE.COMMENT,
},
],
+<<<<<<< HEAD
originalMessage: {
linkedReportID: iouReportID,
},
actorAccountID: currentUserAccountID,
+=======
+ created: DateUtils.getDBTime(),
+ accountID: iouReport.managerID || 0,
+ actorAccountID: iouReport.managerID || 0,
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
};
}
diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js
index e3bd124743b5..6354eee328d3 100644
--- a/src/libs/actions/IOU.js
+++ b/src/libs/actions/IOU.js
@@ -89,7 +89,10 @@ function buildOnyxDataForMoneyRequest(
reportPreviewAction,
isNewChatReport,
isNewIOUReport,
+<<<<<<< HEAD
isNewReportPreviewAction,
+=======
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
) {
const optimisticData = [
{
@@ -124,9 +127,13 @@ function buildOnyxDataForMoneyRequest(
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReport.reportID}`,
value: {
...(isNewChatReport ? {[chatCreatedAction.reportActionID]: chatCreatedAction} : {}),
+<<<<<<< HEAD
[reportPreviewAction.reportActionID]: {
...(isNewReportPreviewAction ? reportPreviewAction : {created: DateUtils.getDBTime()}),
},
+=======
+ [reportPreviewAction.reportActionID]: reportPreviewAction,
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
},
},
{
@@ -139,7 +146,11 @@ function buildOnyxDataForMoneyRequest(
},
];
+<<<<<<< HEAD
if (isNewChatReport && !_.isEmpty(optimisticPersonalDetailListAction)) {
+=======
+ if (!_.isEmpty(optimisticPersonalDetailListAction)) {
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
@@ -189,6 +200,7 @@ function buildOnyxDataForMoneyRequest(
},
}
: {}),
+<<<<<<< HEAD
...(isNewReportPreviewAction
? {
[reportPreviewAction.reportActionID]: {
@@ -196,6 +208,11 @@ function buildOnyxDataForMoneyRequest(
},
}
: {}),
+=======
+ [reportPreviewAction.reportActionID]: {
+ pendingAction: null,
+ },
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
},
},
{
@@ -378,6 +395,7 @@ function requestMoney(report, amount, currency, payeeEmail, payeeAccountID, part
);
// Add optimistic personal details for participant
+<<<<<<< HEAD
const optimisticPersonalDetailListAction = {
[payerAccountID]: {
accountID: payerAccountID,
@@ -392,6 +410,27 @@ function requestMoney(report, amount, currency, payeeEmail, payeeAccountID, part
if (!reportPreviewAction) {
isNewReportPreviewAction = true;
reportPreviewAction = ReportUtils.buildOptimisticReportPreview(chatReport.reportID, iouReport.reportID);
+=======
+ const optimisticPersonalDetailListAction = isNewChatReport
+ ? {
+ [payerAccountID]: {
+ accountID: payerAccountID,
+ avatar: UserUtils.getDefaultAvatarURL(payerAccountID),
+ displayName: participant.displayName || payerEmail,
+ login: participant.login,
+ },
+ }
+ : undefined;
+
+ let reportPreviewAction = isNewIOUReport ? null : ReportActionsUtils.getReportPreviewAction(chatReport.reportID, iouReport.reportID);
+ if (reportPreviewAction) {
+ reportPreviewAction.created = DateUtils.getDBTime();
+ const message = ReportUtils.getReportPreviewMessage(iouReport, reportPreviewAction);
+ reportPreviewAction.message[0].html = message;
+ reportPreviewAction.message[0].text = message;
+ } else {
+ reportPreviewAction = ReportUtils.buildOptimisticReportPreview(chatReport, iouReport);
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
}
// STEP 5: Build Onyx Data
@@ -406,7 +445,10 @@ function requestMoney(report, amount, currency, payeeEmail, payeeAccountID, part
reportPreviewAction,
isNewChatReport,
isNewIOUReport,
+<<<<<<< HEAD
isNewReportPreviewAction,
+=======
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
);
// STEP 6: Make the request
@@ -594,11 +636,26 @@ function createSplitsAndOnyxData(participants, currentUserLogin, currentUserAcco
// If we only have one participant and the request was initiated from the global create menu, i.e. !existingGroupChatReportID, the oneOnOneChatReport is the groupChatReport
let oneOnOneChatReport;
let isNewOneOnOneChatReport = false;
+<<<<<<< HEAD
oneOnOneChatReport = !hasMultipleParticipants && !existingGroupChatReportID ? groupChatReport : ReportUtils.getChatByParticipants([accountID]);
if (!oneOnOneChatReport) {
isNewOneOnOneChatReport = true;
oneOnOneChatReport = ReportUtils.buildOptimisticChatReport([accountID]);
+=======
+ let shouldCreateOptimisticPersonalDetails = false;
+
+ // If this is a split between two people only and the function
+ // wasn't provided with an existing group chat report id
+ if (!hasMultipleParticipants && !existingGroupChatReportID) {
+ oneOnOneChatReport = groupChatReport;
+ shouldCreateOptimisticPersonalDetails = !existingGroupChatReport;
+ } else {
+ const existingChatReport = ReportUtils.getChatByParticipants([accountID]);
+ isNewOneOnOneChatReport = !existingChatReport;
+ shouldCreateOptimisticPersonalDetails = isNewOneOnOneChatReport;
+ oneOnOneChatReport = existingChatReport || ReportUtils.buildOptimisticChatReport([accountID]);
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
}
// STEP 2: Get existing IOU report and update its total OR build a new optimistic one
@@ -640,6 +697,7 @@ function createSplitsAndOnyxData(participants, currentUserLogin, currentUserAcco
);
// Add optimistic personal details for new participants
+<<<<<<< HEAD
const oneOnOnePersonalDetailListAction = {
[accountID]: {
accountID,
@@ -654,6 +712,27 @@ function createSplitsAndOnyxData(participants, currentUserLogin, currentUserAcco
if (!oneOnOneReportPreviewAction) {
isNewOneOnOneReportPreviewAction = true;
oneOnOneReportPreviewAction = ReportUtils.buildOptimisticReportPreview(oneOnOneChatReport.reportID, oneOnOneIOUReport.reportID);
+=======
+ const oneOnOnePersonalDetailListAction = shouldCreateOptimisticPersonalDetails
+ ? {
+ [accountID]: {
+ accountID,
+ avatar: UserUtils.getDefaultAvatarURL(accountID),
+ displayName: participant.displayName || email,
+ login: participant.login,
+ },
+ }
+ : undefined;
+
+ let oneOnOneReportPreviewAction = ReportActionsUtils.getReportPreviewAction(oneOnOneChatReport.reportID, oneOnOneIOUReport.reportID);
+ if (oneOnOneReportPreviewAction) {
+ oneOnOneReportPreviewAction.created = DateUtils.getDBTime();
+ const message = ReportUtils.getReportPreviewMessage(oneOnOneIOUReport, oneOnOneReportPreviewAction);
+ oneOnOneReportPreviewAction.message[0].html = message;
+ oneOnOneReportPreviewAction.message[0].text = message;
+ } else {
+ oneOnOneReportPreviewAction = ReportUtils.buildOptimisticReportPreview(oneOnOneChatReport, oneOnOneIOUReport);
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
}
// STEP 5: Build Onyx Data
@@ -668,7 +747,10 @@ function createSplitsAndOnyxData(participants, currentUserLogin, currentUserAcco
oneOnOneReportPreviewAction,
isNewOneOnOneChatReport,
isNewOneOnOneIOUReport,
+<<<<<<< HEAD
isNewOneOnOneReportPreviewAction,
+=======
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
);
const splitData = {
@@ -944,6 +1026,11 @@ function getSendMoneyParams(report, amount, currency, comment, paymentMethodType
true,
);
+<<<<<<< HEAD
+=======
+ const reportPreviewAction = ReportUtils.buildOptimisticReportPreview(chatReport, optimisticIOUReport);
+
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
// First, add data that will be used in all cases
const optimisticChatReportData = {
onyxMethod: Onyx.METHOD.MERGE,
@@ -951,7 +1038,11 @@ function getSendMoneyParams(report, amount, currency, comment, paymentMethodType
value: {
...chatReport,
lastReadTime: DateUtils.getDBTime(),
+<<<<<<< HEAD
lastVisibleActionCreated: optimisticIOUReportAction.created,
+=======
+ lastVisibleActionCreated: reportPreviewAction.created,
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
},
};
const optimisticIOUReportData = {
@@ -963,7 +1054,11 @@ function getSendMoneyParams(report, amount, currency, comment, paymentMethodType
lastMessageHtml: optimisticIOUReportAction.message[0].html,
},
};
+<<<<<<< HEAD
const optimisticReportActionsData = {
+=======
+ const optimisticIOUReportActionsData = {
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${optimisticIOUReport.reportID}`,
value: {
@@ -973,6 +1068,16 @@ function getSendMoneyParams(report, amount, currency, comment, paymentMethodType
},
},
};
+<<<<<<< HEAD
+=======
+ const optimisticChatReportActionsData = {
+ onyxMethod: Onyx.METHOD.SET,
+ key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReport.reportID}`,
+ value: {
+ [reportPreviewAction.reportActionID]: reportPreviewAction,
+ },
+ };
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
const successData = [
{
@@ -989,6 +1094,18 @@ function getSendMoneyParams(report, amount, currency, comment, paymentMethodType
key: `${ONYXKEYS.COLLECTION.TRANSACTION}${optimisticTransaction.transactionID}`,
value: {pendingAction: null},
},
+<<<<<<< HEAD
+=======
+ {
+ onyxMethod: Onyx.METHOD.MERGE,
+ key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReport.reportID}`,
+ value: {
+ [reportPreviewAction.reportActionID]: {
+ pendingAction: null,
+ },
+ },
+ },
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
];
const failureData = [
@@ -1008,7 +1125,10 @@ function getSendMoneyParams(report, amount, currency, comment, paymentMethodType
// Change the method to set for new reports because it doesn't exist yet, is faster,
// and we need the data to be available when we navigate to the chat page
optimisticChatReportData.onyxMethod = Onyx.METHOD.SET;
+<<<<<<< HEAD
optimisticReportActionsData.onyxMethod = Onyx.METHOD.SET;
+=======
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
optimisticIOUReportData.onyxMethod = Onyx.METHOD.SET;
// Set and clear pending fields on the chat report
@@ -1053,8 +1173,13 @@ function getSendMoneyParams(report, amount, currency, comment, paymentMethodType
},
};
+<<<<<<< HEAD
// Add an optimistic created action to the optimistic reportActions data
optimisticReportActionsData.value[optimisticCreatedAction.reportActionID] = optimisticCreatedAction;
+=======
+ // Add an optimistic created action to the optimistic chat reportActions data
+ optimisticChatReportActionsData.value[optimisticCreatedAction.reportActionID] = optimisticCreatedAction;
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
} else {
failureData.push({
onyxMethod: Onyx.METHOD.MERGE,
@@ -1067,7 +1192,11 @@ function getSendMoneyParams(report, amount, currency, comment, paymentMethodType
});
}
+<<<<<<< HEAD
const optimisticData = [optimisticChatReportData, optimisticIOUReportData, optimisticReportActionsData, optimisticTransactionData];
+=======
+ const optimisticData = [optimisticChatReportData, optimisticIOUReportData, optimisticChatReportActionsData, optimisticIOUReportActionsData, optimisticTransactionData];
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
if (!_.isEmpty(optimisticPersonalDetailListData)) {
optimisticData.push(optimisticPersonalDetailListData);
}
@@ -1081,6 +1210,10 @@ function getSendMoneyParams(report, amount, currency, comment, paymentMethodType
transactionID: optimisticTransaction.transactionID,
newIOUReportDetails,
createdReportActionID: isNewChat ? optimisticCreatedAction.reportActionID : 0,
+<<<<<<< HEAD
+=======
+ reportPreviewReportActionID: reportPreviewAction.reportActionID,
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
},
optimisticData,
successData,
@@ -1115,6 +1248,15 @@ function getPayMoneyRequestParams(chatReport, iouReport, recipient, paymentMetho
login: recipient.login,
};
+<<<<<<< HEAD
+=======
+ const optimisticReportPreviewAction = ReportActionsUtils.getReportPreviewAction(chatReport.reportID, iouReport.reportID);
+ optimisticReportPreviewAction.created = DateUtils.getDBTime();
+ const message = ReportUtils.getReportPreviewMessage(iouReport, optimisticReportPreviewAction);
+ optimisticReportPreviewAction.message[0].html = message;
+ optimisticReportPreviewAction.message[0].text = message;
+
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
const optimisticData = [
{
onyxMethod: Onyx.METHOD.MERGE,
@@ -1141,6 +1283,16 @@ function getPayMoneyRequestParams(chatReport, iouReport, recipient, paymentMetho
},
{
onyxMethod: Onyx.METHOD.MERGE,
+<<<<<<< HEAD
+=======
+ key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReport.reportID}`,
+ value: {
+ [optimisticReportPreviewAction.reportActionID]: optimisticReportPreviewAction,
+ },
+ },
+ {
+ onyxMethod: Onyx.METHOD.MERGE,
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport.reportID}`,
value: {
...iouReport,
@@ -1198,6 +1350,18 @@ function getPayMoneyRequestParams(chatReport, iouReport, recipient, paymentMetho
},
{
onyxMethod: Onyx.METHOD.MERGE,
+<<<<<<< HEAD
+=======
+ key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReport.reportID}`,
+ value: {
+ [optimisticReportPreviewAction.reportActionID]: {
+ created: optimisticReportPreviewAction.created,
+ },
+ },
+ },
+ {
+ onyxMethod: Onyx.METHOD.MERGE,
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
key: `${ONYXKEYS.COLLECTION.TRANSACTION}${optimisticTransaction.transactionID}`,
value: {
errors: ErrorUtils.getMicroSecondOnyxError('iou.error.genericCreateFailureMessage'),
diff --git a/src/libs/actions/Task.js b/src/libs/actions/Task.js
index 7a367191be35..ef4cc3eb3591 100644
--- a/src/libs/actions/Task.js
+++ b/src/libs/actions/Task.js
@@ -10,6 +10,10 @@ import ROUTES from '../../ROUTES';
import CONST from '../../CONST';
import DateUtils from '../DateUtils';
import * as UserUtils from '../UserUtils';
+<<<<<<< HEAD
+=======
+import * as ErrorUtils from '../ErrorUtils';
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
import * as ReportActionsUtils from '../ReportActionsUtils';
import * as Expensicons from '../../components/Icon/Expensicons';
@@ -225,7 +229,15 @@ function completeTask(taskReportID, taskTitle) {
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${taskReportID}`,
+<<<<<<< HEAD
value: {[completedTaskReportAction.reportActionID]: {pendingAction: null}},
+=======
+ value: {
+ [completedTaskReportAction.reportActionID]: {
+ errors: ErrorUtils.getMicroSecondOnyxError('task.messages.error'),
+ },
+ },
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
},
];
@@ -281,7 +293,15 @@ function reopenTask(taskReportID, taskTitle) {
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${taskReportID}`,
+<<<<<<< HEAD
value: {[reopenedTaskReportAction.reportActionID]: {pendingAction: null}},
+=======
+ value: {
+ [reopenedTaskReportAction.reportActionID]: {
+ errors: ErrorUtils.getMicroSecondOnyxError('task.messages.error'),
+ },
+ },
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
},
];
diff --git a/src/pages/SearchPage.js b/src/pages/SearchPage.js
index 17ca3a0c0be4..00d90a1c6e2e 100755
--- a/src/pages/SearchPage.js
+++ b/src/pages/SearchPage.js
@@ -61,7 +61,10 @@ class SearchPage extends Component {
this.state = {
searchValue: '',
+<<<<<<< HEAD
headerMessage: '',
+=======
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
recentReports,
personalDetails,
userToInvite,
@@ -129,6 +132,7 @@ class SearchPage extends Component {
this.state.searchValue.trim(),
this.props.betas,
);
+<<<<<<< HEAD
this.setState((prevState) => {
const headerMessage = OptionsListUtils.getHeaderMessage(recentReports.length + personalDetails.length !== 0, Boolean(userToInvite), prevState.searchValue);
return {
@@ -137,6 +141,12 @@ class SearchPage extends Component {
recentReports,
personalDetails,
};
+=======
+ this.setState({
+ userToInvite,
+ recentReports,
+ personalDetails,
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
});
}
@@ -167,6 +177,14 @@ class SearchPage extends Component {
render() {
const sections = this.getSections();
const isOptionsDataReady = ReportUtils.isReportDataReady() && OptionsListUtils.isPersonalDetailsReady(this.props.personalDetails);
+<<<<<<< HEAD
+=======
+ const headerMessage = OptionsListUtils.getHeaderMessage(
+ this.state.recentReports.length + this.state.personalDetails.length !== 0,
+ Boolean(this.state.userToInvite),
+ this.state.searchValue,
+ );
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
return (
@@ -179,7 +197,11 @@ class SearchPage extends Component {
value={this.state.searchValue}
onSelectRow={this.selectReport}
onChangeText={this.onChangeText}
+<<<<<<< HEAD
headerMessage={this.state.headerMessage}
+=======
+ headerMessage={headerMessage}
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
hideSectionHeaders
showTitleTooltip
shouldShowOptions={didScreenTransitionEnd && isOptionsDataReady}
diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js
index 4571e5318a8b..28a945070b6a 100644
--- a/src/pages/home/ReportScreen.js
+++ b/src/pages/home/ReportScreen.js
@@ -134,6 +134,11 @@ class ReportScreen extends React.Component {
isBannerVisible: true,
};
this.firstRenderRef = React.createRef();
+<<<<<<< HEAD
+=======
+ this.firstRenderRef.current = reportActionsListViewHeight === 0;
+
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
this.flatListRef = React.createRef();
this.reactionListRef = React.createRef();
}
@@ -244,8 +249,13 @@ class ReportScreen extends React.Component {
const shouldHideReport = !ReportUtils.canAccessReport(this.props.report, this.props.policies, this.props.betas);
+<<<<<<< HEAD
const isLoading = !reportID || !this.props.isSidebarLoaded || _.isEmpty(this.props.personalDetails) || !this.firstRenderRef.current;
this.firstRenderRef.current = true;
+=======
+ const isLoading = !reportID || !this.props.isSidebarLoaded || _.isEmpty(this.props.personalDetails) || this.firstRenderRef.current;
+ this.firstRenderRef.current = false;
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
const parentReportAction = ReportActionsUtils.getParentReportAction(this.props.report);
const isSingleTransactionView = ReportActionsUtils.isTransactionThread(parentReportAction);
@@ -316,7 +326,15 @@ class ReportScreen extends React.Component {
nativeID={CONST.REPORT.DROP_NATIVE_ID + this.getNavigationKey()}
style={[styles.flex1, styles.justifyContentEnd, styles.overflowHidden]}
onLayout={(event) => {
+<<<<<<< HEAD
const skeletonViewContainerHeight = event.nativeEvent.layout.height;
+=======
+ // Rounding this value for comparison because they can look like this: 411.9999694824219
+ const skeletonViewContainerHeight = Math.round(event.nativeEvent.layout.height);
+
+ // Only set state when the height changes to avoid unnecessary renders
+ if (reportActionsListViewHeight === skeletonViewContainerHeight) return;
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
// The height can be 0 if the component unmounts - we are not interested in this value and want to know how much space it
// takes up so we can set the skeleton view container height.
diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.js b/src/pages/home/report/ContextMenu/ContextMenuActions.js
index 4b7ddaec1f99..eab283d5f9d4 100644
--- a/src/pages/home/report/ContextMenu/ContextMenuActions.js
+++ b/src/pages/home/report/ContextMenu/ContextMenuActions.js
@@ -298,7 +298,11 @@ export default [
onPress: (closePopover, {reportID}) => {
Report.togglePinnedState(reportID, false);
if (closePopover) {
+<<<<<<< HEAD
hideContextMenu(false);
+=======
+ hideContextMenu(false, ReportActionComposeFocusManager.focus);
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
}
},
getDescription: () => {},
@@ -311,7 +315,11 @@ export default [
onPress: (closePopover, {reportID}) => {
Report.togglePinnedState(reportID, true);
if (closePopover) {
+<<<<<<< HEAD
hideContextMenu(false);
+=======
+ hideContextMenu(false, ReportActionComposeFocusManager.focus);
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
}
},
getDescription: () => {},
diff --git a/src/pages/home/report/ReportActionItemMessageEdit.js b/src/pages/home/report/ReportActionItemMessageEdit.js
index 30c64c7cf6b4..f277c60bea67 100644
--- a/src/pages/home/report/ReportActionItemMessageEdit.js
+++ b/src/pages/home/report/ReportActionItemMessageEdit.js
@@ -336,7 +336,11 @@ function ReportActionItemMessageEdit(props) {
}
openReportActionComposeViewWhenClosingMessageEdit();
}}
+<<<<<<< HEAD
selection={selection}
+=======
+ selection={!isFocused ? undefined : selection}
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
onSelectionChange={(e) => setSelection(e.nativeEvent.selection)}
/>
diff --git a/src/pages/tasks/NewTaskPage.js b/src/pages/tasks/NewTaskPage.js
index a2ac357aa17a..80c4c2fc5632 100644
--- a/src/pages/tasks/NewTaskPage.js
+++ b/src/pages/tasks/NewTaskPage.js
@@ -169,7 +169,12 @@ function NewTaskPage(props) {
description={shareDestination.displayName ? shareDestination.subtitle : props.translate('newTaskPage.shareSomewhere')}
icon={shareDestination.icons}
onPress={() => Navigation.navigate(ROUTES.NEW_TASK_SHARE_DESTINATION)}
+<<<<<<< HEAD
shouldShowRightIcon
+=======
+ interactive={!props.task.parentReportID}
+ shouldShowRightIcon={!props.task.parentReportID}
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
/>
>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
},
];
diff --git a/tests/actions/IOUTest.js b/tests/actions/IOUTest.js
index 784ff9a057ca..4dfd4e08d083 100644
--- a/tests/actions/IOUTest.js
+++ b/tests/actions/IOUTest.js
@@ -1104,6 +1104,29 @@ describe('actions/IOU', () => {
});
}),
)
+<<<<<<< HEAD
+=======
+ .then(
+ () =>
+ new Promise((resolve) => {
+ const connectionID = Onyx.connect({
+ key: ONYXKEYS.PERSONAL_DETAILS_LIST,
+ waitForCollectionCallback: true,
+ callback: (allPersonalDetails) => {
+ Onyx.disconnect(connectionID);
+ expect(allPersonalDetails).toMatchObject({
+ [VIT_ACCOUNT_ID]: {
+ accountID: VIT_ACCOUNT_ID,
+ displayName: VIT_EMAIL,
+ login: VIT_EMAIL,
+ },
+ });
+ resolve();
+ },
+ });
+ }),
+ )
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
.then(fetch.resume)
.then(
() =>
diff --git a/tests/unit/EmojiTest.js b/tests/unit/EmojiTest.js
index 9b303e9bfb50..18392da0d5a1 100644
--- a/tests/unit/EmojiTest.js
+++ b/tests/unit/EmojiTest.js
@@ -182,6 +182,10 @@ describe('EmojiTest', () => {
name: 'wave',
count: 2,
lastUpdatedAt: 4,
+<<<<<<< HEAD
+=======
+ types: ['👋🏿', '👋🏾', '👋🏽', '👋🏼', '👋🏻'],
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
},
{
code: '💤',
@@ -234,6 +238,10 @@ describe('EmojiTest', () => {
name: 'wave',
count: 2,
lastUpdatedAt: 4,
+<<<<<<< HEAD
+=======
+ types: ['👋🏿', '👋🏾', '👋🏽', '👋🏼', '👋🏻'],
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
},
{
code: '💤',
@@ -280,6 +288,10 @@ describe('EmojiTest', () => {
name: 'wave',
count: 2,
lastUpdatedAt: 4,
+<<<<<<< HEAD
+=======
+ types: ['👋🏿', '👋🏾', '👋🏽', '👋🏼', '👋🏻'],
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
},
{...zzzEmoji, count: 2, lastUpdatedAt: 3},
{
@@ -329,6 +341,10 @@ describe('EmojiTest', () => {
name: 'wave',
count: 3,
lastUpdatedAt: 23,
+<<<<<<< HEAD
+=======
+ types: ['👋🏿', '👋🏾', '👋🏽', '👋🏼', '👋🏻'],
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
},
{
code: '😡',
@@ -389,6 +405,10 @@ describe('EmojiTest', () => {
name: 'baby',
count: 3,
lastUpdatedAt: 13,
+<<<<<<< HEAD
+=======
+ types: ['👶🏿', '👶🏾', '👶🏽', '👶🏼', '👶🏻'],
+>>>>>>> 1a4190b (Merge pull request #22662 from Expensify/stites-fixFrequentlyUsedEmojis)
},
{
code: '👄',