Skip to content

Commit

Permalink
psp-7209 do not display acquisition file until all loading state is c…
Browse files Browse the repository at this point in the history
…omplete and context is initialized.
  • Loading branch information
devinleighsmith committed Nov 8, 2023
1 parent f67bcdd commit 2efbd0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,12 @@ export const AcquisitionContainer: React.FunctionComponent<IAcquisitionContainer
};

// UI components
if (loadingAcquisitionFile || (loadingAcquisitionFileProperties && !isPropertySelector)) {
if (
loadingAcquisitionFile ||
(loadingAcquisitionFileProperties && !isPropertySelector) ||
file?.fileType !== FileTypes.Acquisition ||
file?.id !== acquisitionFileId
) {
return <LoadingBackdrop show={true} parentScreen={true}></LoadingBackdrop>;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ export const AcquisitionView: React.FunctionComponent<IAcquisitionViewProps> = (
const history = useHistory();
const match = useRouteMatch();
const { file, lastUpdatedBy } = useContext(SideBarContext);
if (!!file && file?.fileType !== FileTypes.Acquisition) {
throw Error('Context file is not an acquisition file');
}
const acquisitionFile: Api_AcquisitionFile = file as Api_AcquisitionFile;

// match for property menu routes - eg /property/1/ltsa
Expand Down

0 comments on commit 2efbd0a

Please sign in to comment.