✨ Document non trouvé n'apparaît plus
This commit is contained in:
parent
1882fa6b6c
commit
8e91736c77
@ -34,6 +34,7 @@ type IState = {
|
||||
validatedPercentage: number;
|
||||
document: Document | null;
|
||||
fileBlob: Blob | null;
|
||||
isLoading: boolean;
|
||||
};
|
||||
|
||||
class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
||||
@ -49,6 +50,7 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
||||
validatedPercentage: this.getRandomPercentageForOcr(),
|
||||
document: null,
|
||||
fileBlob: null,
|
||||
isLoading: true,
|
||||
};
|
||||
|
||||
this.closeModals = this.closeModals.bind(this);
|
||||
@ -68,7 +70,7 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
||||
public override render(): JSX.Element | null {
|
||||
return (
|
||||
<DefaultNotaryDashboard title={"Demander des documents"} hasBackArrow mobileBackText="Retour aux documents">
|
||||
{this.state.document && this.state.document.files && this.state.selectedFile && (
|
||||
{this.state.document && this.state.document.files && this.state.selectedFile && !this.state.isLoading && (
|
||||
<div className={classes["root"]}>
|
||||
<Typography typo={ITypo.H1} color={ITypoColor.BLACK} className={classes["title"]}>
|
||||
{this.state.document.folder?.name}
|
||||
@ -156,7 +158,7 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
||||
</Confirm>
|
||||
</div>
|
||||
)}
|
||||
{(!this.state.selectedFile || !this.state.document) && (
|
||||
{(!this.state.selectedFile || !this.state.document) && !this.state.isLoading && (
|
||||
<div className={classes["root"]}>
|
||||
<Typography typo={ITypo.P_16} color={ITypoColor.BLACK} className={classes["refuse-text"]}>
|
||||
Document non trouvé
|
||||
@ -182,12 +184,16 @@ class ViewDocumentsClass extends BasePage<IPropsClass, IState> {
|
||||
document,
|
||||
selectedFileIndex: 0,
|
||||
selectedFile: document.files![0]!,
|
||||
isLoading: false,
|
||||
},
|
||||
() => {
|
||||
this.getFilePreview();
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
this.setState({
|
||||
isLoading: false,
|
||||
});
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user