-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 27054 Conversations do not load if you interrupt the Internet connection when logging in #27380
fix: 27054 Conversations do not load if you interrupt the Internet connection when logging in #27380
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,10 +141,11 @@ function getPolicyParamsForOpenOrReconnect() { | |
|
||
/** | ||
* Returns the Onyx data that is used for both the OpenApp and ReconnectApp API commands. | ||
* @param {Boolean} isOpenApp | ||
* @returns {Object} | ||
*/ | ||
function getOnyxDataForOpenOrReconnect() { | ||
return { | ||
function getOnyxDataForOpenOrReconnect(isOpenApp = false) { | ||
const defaultData = { | ||
optimisticData: [ | ||
{ | ||
onyxMethod: Onyx.METHOD.MERGE, | ||
|
@@ -167,14 +168,41 @@ function getOnyxDataForOpenOrReconnect() { | |
}, | ||
], | ||
}; | ||
if (!isOpenApp) return defaultData; | ||
return { | ||
optimisticData: [ | ||
...defaultData.optimisticData, | ||
{ | ||
onyxMethod: Onyx.METHOD.MERGE, | ||
key: ONYXKEYS.IS_LOADING_APP, | ||
value: true, | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if it's a bad thing and haven't looked into the P/S - but got curious about why we need this. I see a lot of places in the app are "waiting" for the "is loading app" flag now and wonder if we need to do it in all those places or not... "is loading app" sort of confuses me as a variable name. Maybe would have been better to call this: |
||
], | ||
successData: [ | ||
...defaultData.successData, | ||
{ | ||
onyxMethod: Onyx.METHOD.MERGE, | ||
key: ONYXKEYS.IS_LOADING_APP, | ||
value: false, | ||
}, | ||
], | ||
failureData: [ | ||
...defaultData.failureData, | ||
{ | ||
onyxMethod: Onyx.METHOD.MERGE, | ||
key: ONYXKEYS.IS_LOADING_APP, | ||
value: false, | ||
}, | ||
], | ||
}; | ||
} | ||
|
||
/** | ||
* Fetches data needed for app initialization | ||
*/ | ||
function openApp() { | ||
getPolicyParamsForOpenOrReconnect().then((policyParams) => { | ||
API.read('OpenApp', policyParams, getOnyxDataForOpenOrReconnect()); | ||
API.read('OpenApp', policyParams, getOnyxDataForOpenOrReconnect(true)); | ||
}); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's more than report data. And this comment looks copy-pasta