Skip to content

Commit 45b6a52

Browse files
fix: prevent loading indicator from displaying when offline
1 parent 15c2eb6 commit 45b6a52

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/pages/workspace/WorkspacePageWithSections.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ function WorkspacePageWithSections({
128128
}: WorkspacePageWithSectionsProps) {
129129
const styles = useThemeStyles();
130130
const policyID = route.params?.policyID;
131-
useNetwork({onReconnect: () => fetchData(policyID, shouldSkipVBBACall)});
131+
const {isOffline} = useNetwork({onReconnect: () => fetchData(policyID, shouldSkipVBBACall)});
132132

133133
const [account] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: false});
134134
const [reimbursementAccount = CONST.REIMBURSEMENT_ACCOUNT.DEFAULT_DATA] = useOnyx(ONYXKEYS.REIMBURSEMENT_ACCOUNT, {canBeMissing: true});
@@ -218,7 +218,7 @@ function WorkspacePageWithSections({
218218
>
219219
{headerContent}
220220
</HeaderWithBackButton>
221-
{(isLoading || firstRender.current) && shouldShowLoading && isFocused ? (
221+
{!isOffline && (isLoading || firstRender.current) && shouldShowLoading && isFocused ? (
222222
<FullScreenLoadingIndicator style={[styles.flex1, styles.pRelative]} />
223223
) : (
224224
<>

0 commit comments

Comments
 (0)