Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kubabutkiewicz committed Jan 31, 2025
1 parent 407dbfd commit 4f5862f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/components/ImportOnyxState/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export default function ImportOnyxState({setIsLoading}: ImportOnyxStateProps) {
}

rollbackOngoingRequest();

setIsLoading(true);
readOnyxFile(file.uri)
.then((fileContent: string) => {
Expand Down
2 changes: 2 additions & 0 deletions src/components/ImportOnyxState/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {useOnyx} from 'react-native-onyx';
import type {FileObject} from '@components/AttachmentModal';
import {setIsUsingImportedState, setPreservedUserSession} from '@libs/actions/App';
import {setShouldForceOffline} from '@libs/actions/Network';
import {rollbackOngoingRequest} from '@libs/actions/PersistedRequests';
import Navigation from '@libs/Navigation/Navigation';
import type {OnyxValues} from '@src/ONYXKEYS';
import ONYXKEYS from '@src/ONYXKEYS';
Expand All @@ -20,6 +21,7 @@ export default function ImportOnyxState({setIsLoading}: ImportOnyxStateProps) {
return;
}

rollbackOngoingRequest();
setIsLoading(true);

const blob = new Blob([file as BlobPart]);
Expand Down
1 change: 1 addition & 0 deletions src/libs/actions/PersistedRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Onyx.connect({

if (ongoingRequest && persistedRequests.length > 0) {
const nextRequestToProcess = persistedRequests.at(0);

// We try to remove the next request from the persistedRequests if it is the same as ongoingRequest
// so we don't process it twice.
if (isEqual(nextRequestToProcess, ongoingRequest)) {
Expand Down

0 comments on commit 4f5862f

Please sign in to comment.