Skip to content

Commit

Permalink
refactor: changed conts variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
barttom committed Sep 25, 2023
1 parent 54e0f20 commit 47a5d08
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ const CONST = {
GOLD: 'GOLD',
SILVER: 'SILVER',
},
STATEMENT_WEB_MESSAGE_TYPE: {
WEB_MESSAGE_TYPE: {
STATEMENT: 'STATEMENT_NAVIGATE',
CONCIERGE: 'CONCIERGE_NAVIGATE',
},
Expand Down
6 changes: 3 additions & 3 deletions src/components/WalletStatementModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ function WalletStatementModal({statementPageURL, session}) {
* @param {MessageEvent} event
*/
const navigate = (event) => {
if (!event.data || !event.data.type || (event.data.type !== 'STATEMENT_NAVIGATE' && event.data.type !== 'CONCIERGE_NAVIGATE')) {
if (!event.data || !event.data.type || (event.data.type !== CONST.WALLET.WEB_MESSAGE_TYPE.STATEMENT && event.data.type !== CONST.WALLET.WEB_MESSAGE_TYPE.CONCIERGE)) {
return;
}

if (event.data.type === CONST.WALLET.STATEMENT_WEB_MESSAGE_TYPE.CONCIERGE) {
if (event.data.type === CONST.WALLET.WEB_MESSAGE_TYPE.CONCIERGE) {
Report.navigateToConciergeChat();
}

if (event.data.type === CONST.WALLET.STATEMENT_WEB_MESSAGE_TYPE.STATEMENT && event.data.url) {
if (event.data.type === CONST.WALLET.WEB_MESSAGE_TYPE.STATEMENT && event.data.url) {
const iouRoutes = [ROUTES.IOU_REQUEST, ROUTES.IOU_SEND];
const navigateToIOURoute = _.find(iouRoutes, (iouRoute) => event.data.url.includes(iouRoute));
if (navigateToIOURoute) {
Expand Down
6 changes: 3 additions & 3 deletions src/components/WalletStatementModal/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ function WalletStatementModal({statementPageURL, session}) {
*/
const handleNavigationStateChange = useCallback(
({type, url}) => {
if (!webViewRef.current || (type !== 'STATEMENT_NAVIGATE' && type !== 'CONCIERGE_NAVIGATE')) {
if (!webViewRef.current || (type !== CONST.WALLET.WEB_MESSAGE_TYPE.STATEMENT && type !== CONST.WALLET.WEB_MESSAGE_TYPE.CONCIERGE)) {
return;
}

if (type === CONST.WALLET.STATEMENT_WEB_MESSAGE_TYPE.CONCIERGE) {
if (type === CONST.WALLET.WEB_MESSAGE_TYPE.CONCIERGE) {
webViewRef.current.stopLoading();
Report.navigateToConciergeChat();
}

if (type === CONST.WALLET.STATEMENT_WEB_MESSAGE_TYPE.STATEMENT && url) {
if (type === CONST.WALLET.WEB_MESSAGE_TYPE.STATEMENT && url) {
const iouRoute = _.find(IOU_ROUTES, (item) => url.includes(item));

if (iouRoute) {
Expand Down

0 comments on commit 47a5d08

Please sign in to comment.