Skip to content

Commit

Permalink
使用then替换finally
Browse files Browse the repository at this point in the history
  • Loading branch information
HFO4 committed Mar 12, 2020
1 parent 10b768a commit 73ba75b
Show file tree
Hide file tree
Showing 33 changed files with 51 additions and 51 deletions.
2 changes: 1 addition & 1 deletion src/component/Admin/Dialogs/AddRedeem.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function AddRedeem({ open, onClose,products ,onSuccess}) {
})
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
}).finally(()=>{
}).then(()=>{
setLoading(false);
});

Expand Down
4 changes: 2 additions & 2 deletions src/component/Admin/File/File.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default function File() {
})
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
}).finally(()=>{
}).then(()=>{
setLoading(false);
});
};
Expand All @@ -141,7 +141,7 @@ export default function File() {
})
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
}).finally(()=>{
}).then(()=>{
setLoading(false);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/component/Admin/Group/GroupForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export default function GroupForm(props) {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});

Expand Down
6 changes: 3 additions & 3 deletions src/component/Admin/Policy/Guid/COSGuide.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export default function COSGuide(props) {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});

Expand All @@ -226,7 +226,7 @@ export default function COSGuide(props) {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});

Expand All @@ -245,7 +245,7 @@ export default function COSGuide(props) {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/component/Admin/Policy/Guid/EditPro.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default function EditPro(props) {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});

Expand Down
4 changes: 2 additions & 2 deletions src/component/Admin/Policy/Guid/LocalGuide.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default function LocalGuide(props) {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});
};
Expand Down Expand Up @@ -202,7 +202,7 @@ export default function LocalGuide(props) {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});

Expand Down
4 changes: 2 additions & 2 deletions src/component/Admin/Policy/Guid/OSSGuide.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export default function OSSGuide(props) {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});

Expand All @@ -218,7 +218,7 @@ export default function OSSGuide(props) {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});

Expand Down
2 changes: 1 addition & 1 deletion src/component/Admin/Policy/Guid/OneDriveGuide.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export default function OneDriveGuide(props) {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});

Expand Down
2 changes: 1 addition & 1 deletion src/component/Admin/Policy/Guid/QiniuGuide.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export default function RemoteGuide(props) {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});

Expand Down
4 changes: 2 additions & 2 deletions src/component/Admin/Policy/Guid/RemoteGuide.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export default function RemoteGuide(props) {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});
};
Expand Down Expand Up @@ -216,7 +216,7 @@ export default function RemoteGuide(props) {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});

Expand Down
2 changes: 1 addition & 1 deletion src/component/Admin/Policy/Guid/UpyunGuide.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export default function UpyunGuide(props) {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});

Expand Down
2 changes: 1 addition & 1 deletion src/component/Admin/Setting/Access.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default function Access() {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});
};
Expand Down
6 changes: 3 additions & 3 deletions src/component/Admin/Setting/Aria2.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default function Aria2() {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {});
.then(() => {});
};

const test = () =>{
Expand All @@ -93,7 +93,7 @@ export default function Aria2() {
})
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
}).finally(()=>{
}).then(()=>{
setLoading(false);
});
}
Expand All @@ -117,7 +117,7 @@ export default function Aria2() {
})
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
}).finally(()=>{
}).then(()=>{
setLoading(false);
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/component/Admin/Setting/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default function ImageSetting() {
})
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
}).finally(()=>{
}).then(()=>{
setLoading(false);
});
};
Expand Down
6 changes: 3 additions & 3 deletions src/component/Admin/Setting/Mail.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default function Mail() {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});
};
Expand All @@ -105,7 +105,7 @@ export default function Mail() {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {});
.then(() => {});
};

const submit = e => {
Expand All @@ -128,7 +128,7 @@ export default function Mail() {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/component/Admin/Setting/SiteInformation.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default function SiteInformation() {
})
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
}).finally(()=>{
}).then(()=>{
setLoading(false);
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/component/Admin/Setting/Theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export default function Theme() {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/component/Admin/Setting/UploadDownload.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default function UploadDownload() {
})
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
}).finally(()=>{
}).then(()=>{
setLoading(false);
});
};
Expand Down
4 changes: 2 additions & 2 deletions src/component/Admin/Share/Share.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default function Share() {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});
};
Expand All @@ -137,7 +137,7 @@ export default function Share() {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});
};
Expand Down
4 changes: 2 additions & 2 deletions src/component/Admin/Task/Download.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default function Download() {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});
};
Expand All @@ -136,7 +136,7 @@ export default function Download() {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});
};
Expand Down
4 changes: 2 additions & 2 deletions src/component/Admin/Task/Task.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default function Task() {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});
};
Expand All @@ -137,7 +137,7 @@ export default function Task() {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});
};
Expand Down
6 changes: 3 additions & 3 deletions src/component/Admin/User/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default function Group() {
})
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
}).finally(()=>{
}).then(()=>{
setLoading(false);
});
};
Expand All @@ -143,7 +143,7 @@ export default function Group() {
})
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
}).finally(()=>{
}).then(()=>{
setLoading(false);
});
}
Expand All @@ -162,7 +162,7 @@ export default function Group() {
})
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
}).finally(()=>{
}).then(()=>{
setLoading(false);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/component/Admin/User/UserForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default function UserForm(props) {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});
};
Expand Down
6 changes: 3 additions & 3 deletions src/component/Download/DownloadingCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export default function DownloadingCard(props) {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});
};
Expand Down Expand Up @@ -291,7 +291,7 @@ export default function DownloadingCard(props) {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});
};
Expand All @@ -308,7 +308,7 @@ export default function DownloadingCard(props) {
.catch(error => {
ToggleSnackbar("top", "right", error.message, "error");
})
.finally(() => {
.then(() => {
setLoading(false);
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/component/FileManager/Modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ class ModalsCompoment extends Component {
);
this.props.setModalsLoading(false);
})
.finally(() => {
.then(() => {
this.props.closeAllModals();
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/component/Login/LoginForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function LoginForm() {
console.log(error);
ToggleSnackbar("top", "right", error.message, "warning");
})
.finally(() => {
.then(() => {
setLoading(false);
});
};
Expand Down
Loading

0 comments on commit 73ba75b

Please sign in to comment.