1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 00:20:07 +00:00

fix repo history set limit (#7382)

This commit is contained in:
Michael An
2025-01-17 17:33:50 +08:00
committed by GitHub
parent 859074c5d1
commit 41efd64872

View File

@@ -48,11 +48,9 @@ class LibHistorySetting extends React.Component {
days = this.state.expireDays;
}
let repoID = this.props.repoID;
let reg = /^-?\d+$/;
let flag = reg.test(days);
if (flag) {
if (Number(days) > 0) {
let message = gettext('Successfully set library history.');
seafileAPI.setRepoHistoryLimit(repoID, days).then(res => {
seafileAPI.setRepoHistoryLimit(repoID, parseInt(days)).then(res => {
toaster.success(message);
this.setState({ keepDays: res.data.keep_days });
this.props.toggleDialog();