diff --git a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx index aeee5287..684a6806 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/index.tsx @@ -48,6 +48,7 @@ type IState = { hasValidateAnchoring: boolean; isVerifDeleteModalVisible: boolean; isPreventArchiveModalOpen: boolean; + loadingAnchoring: boolean; }; class FolderInformationClass extends BasePage { public constructor(props: IPropsClass) { @@ -59,6 +60,7 @@ class FolderInformationClass extends BasePage { hasValidateAnchoring: false, isVerifDeleteModalVisible: false, isPreventArchiveModalOpen: false, + loadingAnchoring: false, }; this.openArchivedModal = this.openArchivedModal.bind(this); this.closeArchivedModal = this.closeArchivedModal.bind(this); @@ -159,8 +161,16 @@ class FolderInformationClass extends BasePage { {this.props.isAnchored === AnchorStatus.VERIFIED_ON_CHAIN && ( )} @@ -339,7 +349,7 @@ class FolderInformationClass extends BasePage { private async downloadAnchoringProof(uid?: string) { if (!uid) return; - + this.setState({ loadingAnchoring: true }); try { const file: Blob = await OfficeFolderAnchors.getInstance().download(uid); const url = window.URL.createObjectURL(file); @@ -351,7 +361,9 @@ class FolderInformationClass extends BasePage { document.body.appendChild(a); a.click(); window.URL.revokeObjectURL(url); + this.setState({ loadingAnchoring: false }); } catch (e) { + this.setState({ loadingAnchoring: false }); console.error(e); } } diff --git a/src/front/Components/Layouts/FolderArchived/FolderInformation/classes.module.scss b/src/front/Components/Layouts/FolderArchived/FolderInformation/classes.module.scss index 7b91758b..be75ff2b 100644 --- a/src/front/Components/Layouts/FolderArchived/FolderInformation/classes.module.scss +++ b/src/front/Components/Layouts/FolderArchived/FolderInformation/classes.module.scss @@ -95,7 +95,7 @@ justify-content: center; height: 100%; .loader { - width: 40px; - height: 40px; + width: 21px; + height: 21px; } } diff --git a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx index c11a8732..9e06a63c 100644 --- a/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx +++ b/src/front/Components/Layouts/FolderArchived/FolderInformation/index.tsx @@ -32,6 +32,7 @@ type IPropsClass = IProps & { type IState = { selectedFolder: OfficeFolder | null; isArchivedModalOpen: boolean; + loadingAnchoring: boolean; }; class FolderInformationClass extends BasePage { public constructor(props: IPropsClass) { @@ -39,6 +40,7 @@ class FolderInformationClass extends BasePage { this.state = { selectedFolder: null, isArchivedModalOpen: false, + loadingAnchoring: false, }; this.onSelectedFolder = this.onSelectedFolder.bind(this); this.openArchivedModal = this.openArchivedModal.bind(this); @@ -119,8 +121,16 @@ class FolderInformationClass extends BasePage { {this.props.isAnchored === AnchorStatus.VERIFIED_ON_CHAIN && ( )} @@ -180,7 +190,7 @@ class FolderInformationClass extends BasePage { private async downloadAnchoringProof(uid?: string) { if (!uid) return; - + this.setState({ loadingAnchoring: true }); try { const file: Blob = await OfficeFolderAnchors.getInstance().download(uid); const url = window.URL.createObjectURL(file); @@ -192,7 +202,9 @@ class FolderInformationClass extends BasePage { document.body.appendChild(a); a.click(); window.URL.revokeObjectURL(url); + this.setState({ loadingAnchoring: false }); } catch (e) { + this.setState({ loadingAnchoring: false }); console.error(e); } }