Skip to content

Commit

Permalink
Merge pull request #5466 from Expensify/marcaaron-fixNewToOldDotLinks
Browse files Browse the repository at this point in the history
Use correct api params for NewDot>OldDot links

(cherry picked from commit 420504f)
  • Loading branch information
Jag96 authored and Jag96 committed Sep 23, 2021
1 parent e411161 commit 6305a8c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/libs/actions/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ import Performance from '../Performance';
import Timing from './Timing';

let currentUserAccountID;
let currentUserEmail;
Onyx.connect({
key: ONYXKEYS.SESSION,
callback: (val) => {
currentUserAccountID = lodashGet(val, 'accountID', '');
currentUserEmail = lodashGet(val, 'email', '');
},
});

Expand Down Expand Up @@ -48,8 +50,8 @@ function setLocale(locale) {
* @param {string} url relative URL starting with `/` to open in expensify.com
*/
function openSignedInLink(url = '') {
API.GetShortLivedAuthToken().then((response) => {
Linking.openURL(`${CONFIG.EXPENSIFY.URL_EXPENSIFY_COM}${url}${url.indexOf('?') === -1 ? '?' : '&'}authToken=${response.authToken}&email=${encodeURIComponent(response.email)}`);
API.GetShortLivedAuthToken().then(({shortLivedAuthToken}) => {
Linking.openURL(`${CONFIG.EXPENSIFY.URL_EXPENSIFY_COM}${url}${url.indexOf('?') === -1 ? '?' : '&'}authToken=${shortLivedAuthToken}&email=${encodeURIComponent(currentUserEmail)}`);
});
}

Expand Down

0 comments on commit 6305a8c

Please sign in to comment.