1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-05 08:53:14 +00:00

[eslint] updated eslintrc and improved the code (#4702)

This commit is contained in:
llj
2020-11-02 13:56:35 +08:00
committed by GitHub
parent ed3e5fc416
commit 04f29704b3
337 changed files with 1586 additions and 1585 deletions

View File

@@ -34,7 +34,7 @@ class GenerateShareLink extends React.Component {
expirationLimitTip = gettext('{minDays_placeholder} - {maxDays_placeholder} days')
.replace('{minDays_placeholder}', shareLinkExpireDaysMin)
.replace('{maxDays_placeholder}', shareLinkExpireDaysMax);
} else if (shareLinkExpireDaysMin !== 0 && shareLinkExpireDaysMax === 0) {
} else if (shareLinkExpireDaysMin !== 0 && shareLinkExpireDaysMax === 0) {
expirationLimitTip = gettext('Greater than or equal to {minDays_placeholder} days')
.replace('{minDays_placeholder}', shareLinkExpireDaysMin);
} else if (shareLinkExpireDaysMin === 0 && shareLinkExpireDaysMax !== 0) {
@@ -133,7 +133,7 @@ class GenerateShareLink extends React.Component {
const endDay = moment().add(shareLinkExpireDaysMax, 'days');
if (shareLinkExpireDaysMin !== 0 && shareLinkExpireDaysMax !== 0) {
return current.isBefore(startDay, 'day') || current.isAfter(endDay, 'day');
} else if (shareLinkExpireDaysMin !== 0 && shareLinkExpireDaysMax === 0) {
} else if (shareLinkExpireDaysMin !== 0 && shareLinkExpireDaysMax === 0) {
return current.isBefore(startDay, 'day');
} else if (shareLinkExpireDaysMin === 0 && shareLinkExpireDaysMax !== 0) {
return current.isBefore(moment(), 'day') || current.isAfter(endDay, 'day');
@@ -194,7 +194,7 @@ class GenerateShareLink extends React.Component {
const permissionDetails = Utils.getShareLinkPermissionObject(this.state.currentPermission).permissionDetails;
permissions = JSON.stringify(permissionDetails);
}
let expirationTime = '';
let expirationTime = '';
if (isExpireChecked) {
if (setExp == 'by-days') {
expirationTime = moment().add(parseInt(expireDays), 'days').format();
@@ -469,7 +469,7 @@ class GenerateShareLink extends React.Component {
<Label check>
{this.isExpireDaysNoLimit ? (
<Input type="checkbox" onChange={this.onExpireChecked} />
) : (
) : (
<Input type="checkbox" checked readOnly disabled />
)}
<span>{gettext('Add auto expiration')}</span>