Web: Settings: Backup: Added possibility to set loading for outside components.

This commit is contained in:
Tatiana Lopaeva 2021-05-18 11:19:55 +03:00
parent 84d9eebce9
commit c24fe6a9ab

View File

@ -43,14 +43,19 @@ class ThirdPartyStorageModule extends React.PureComponent {
};
}
componentDidMount() {
const { onSetLoadingData } = this.props;
this.setState(
{
isLoading: true,
},
function () {
onSetLoadingData && onSetLoadingData(true);
getBackupStorage()
.then((storageBackup) => this.getOptions(storageBackup))
.finally(() => this.setState({ isLoading: false }));
.finally(() => {
onSetLoadingData && onSetLoadingData(false);
this.setState({ isLoading: false });
});
}
);
}