Skip to content

Commit

Permalink
Merge pull request #3865 from parasharrajat/parasharrajat/GSD
Browse files Browse the repository at this point in the history
Fixed Loading spinner on login form and crash after Login
  • Loading branch information
chiragsalian authored Jul 7, 2021
2 parents e78340b + d189ca6 commit 38830cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ function createOption(personalDetailList, report, draftComments, {
}) {
const hasMultipleParticipants = personalDetailList.length > 1;
const personalDetail = personalDetailList[0];
const hasDraftComment = report
const reportDraftComment = report
&& draftComments
&& lodashGet(draftComments, `${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${report.reportID}`, '').length > 0;
&& lodashGet(draftComments, `${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${report.reportID}`, '');

const hasOutstandingIOU = lodashGet(report, 'hasOutstandingIOU', false);
const lastActorDetails = report ? _.find(personalDetailList, {login: report.lastActorEmail}) : null;
Expand Down Expand Up @@ -223,7 +223,7 @@ function createOption(personalDetailList, report, draftComments, {
login: !hasMultipleParticipants ? personalDetail.login : null,
reportID: report ? report.reportID : null,
isUnread: report ? report.unreadActionCount > 0 : null,
hasDraftComment,
hasDraftComment: reportDraftComment && reportDraftComment.length > 0,
keyForList: report ? String(report.reportID) : personalDetail.login,
searchText: getSearchText(report, personalDetailList, isDefaultChatRoom),
isPinned: lodashGet(report, 'isPinned', false),
Expand Down Expand Up @@ -307,13 +307,13 @@ function getOptions(reports, personalDetails, draftComments, activeReportID, {
return;
}

const hasDraftComment = report
const reportDraftComment = report
&& draftComments
&& lodashGet(draftComments, `${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${report.reportID}`, '').length > 0;
&& lodashGet(draftComments, `${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${report.reportID}`, '');

const shouldFilterReportIfEmpty = !showReportsWithNoComments && report.lastMessageTimestamp === 0;
const shouldFilterReportIfRead = hideReadReports && report.unreadActionCount === 0;
const shouldShowReportIfHasDraft = showReportsWithDrafts && hasDraftComment;
const shouldShowReportIfHasDraft = showReportsWithDrafts && reportDraftComment && reportDraftComment.length > 0;
const shouldFilterReport = shouldFilterReportIfEmpty || shouldFilterReportIfRead;
if (report.reportID !== activeReportID
&& !report.isPinned
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/Session.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function resendValidationLink(login = credentials.login) {
function fetchAccountDetails(login) {
Onyx.merge(ONYXKEYS.ACCOUNT, {...CONST.DEFAULT_ACCOUNT_DATA, loading: true});

API.GetAccountStatus({email: login})
API.GetAccountStatus({email: login, forceNetworkRequest: true})
.then((response) => {
if (response.jsonCode === 200) {
Onyx.merge(ONYXKEYS.CREDENTIALS, {
Expand Down

0 comments on commit 38830cf

Please sign in to comment.