Web: Added information update when connecting via dialog.

This commit is contained in:
Tatiana Lopaeva 2022-10-14 11:31:40 +03:00
parent 6b183f2ddb
commit b55107dffd
3 changed files with 21 additions and 9 deletions

View File

@ -26,10 +26,10 @@ const PureConnectDialogContainer = (props) => {
setConnectDialogVisible,
personal,
folderFormValidation,
updateInfo,
isConnectionViaBackupModule,
roomCreation,
setSaveThirdpartyResponse,
setSelectedThirdPartyAccount,
} = props;
const {
corporate,
@ -134,14 +134,15 @@ const PureConnectDialogContainer = (props) => {
provider_key,
provider_id
)
.catch((err) => {
setIsLoading(false);
.then(() => {
onClose();
setSelectedThirdPartyAccount(null);
})
.catch((err) => {
toastr.error(err);
})
.finally(() => {
setIsLoading(false);
updateInfo && updateInfo();
onClose();
});
@ -372,7 +373,10 @@ export default inject(
const { personal, folderFormValidation } = auth.settingsStore;
const { id, folders } = selectedFolderStore;
const { selectedThirdPartyAccount: backupConnectionItem } = backup;
const {
selectedThirdPartyAccount: backupConnectionItem,
setSelectedThirdPartyAccount,
} = backup;
const {
connectDialogVisible: visible,
setConnectDialogVisible,
@ -398,7 +402,7 @@ export default inject(
openConnectWindow,
fetchThirdPartyProviders,
setConnectDialogVisible,
setSelectedThirdPartyAccount,
personal,
};
}

View File

@ -56,6 +56,11 @@ const DirectThirdPartyConnection = (props) => {
};
}, []);
useEffect(() => {
updateAccountsInfo();
}, [selectedThirdPartyAccount === null]);
const initialState = {
folderList: [],
isLoading: false,
@ -235,8 +240,8 @@ const DirectThirdPartyConnection = (props) => {
provider_key,
provider_id
);
updateAccountsInfo();
console.log("saveSettings");
setSelectedThirdPartyAccount(null);
} catch (e) {
setState({ isLoading: false, isUpdatingInfo: false });
toastr.error(e);

View File

@ -146,9 +146,12 @@ class BackupStore {
setSelectedThirdPartyAccount = (elem) => {
this.selectedThirdPartyAccount = elem;
};
get selectedThirdPartyAccount() {
return this.selectedThirdPartyAccount;
}
toDefault = () => {
this.selectedMonthlySchedule = this.defaultMonthlySchedule;
this.selectedWeeklySchedule = this.defaultWeeklySchedule;