1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-30 13:23:14 +00:00

fix draft bug

This commit is contained in:
ilearnit 2019-04-17 05:08:47 +00:00
parent 6e2a031302
commit c29e958436
2 changed files with 14 additions and 10 deletions

View File

@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import cookie from 'react-cookies'; import cookie from 'react-cookies';
import moment from 'moment'; import moment from 'moment';
import { gettext, siteRoot, username, canGenerateShareLink, canGenerateUploadLink } from '../../utils/constants'; import { gettext, siteRoot, username, canGenerateShareLink, canGenerateUploadLink, isDocs } from '../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api'; import { seafileAPI } from '../../utils/seafile-api';
import { Utils } from '../../utils/utils'; import { Utils } from '../../utils/utils';
import collabServer from '../../utils/collab-server'; import collabServer from '../../utils/collab-server';
@ -236,11 +236,13 @@ class LibContentView extends React.Component {
this.updateUsedRepoTags(); this.updateUsedRepoTags();
// list draft counts and revierw counts // list draft counts and revierw counts
seafileAPI.getRepoDraftCounts(repoID).then(res => { if (isDocs) {
this.setState({ seafileAPI.getRepoDraftCounts(repoID).then(res => {
draftCounts: res.data.draft_counts, this.setState({
draftCounts: res.data.draft_counts,
});
}); });
}); }
if (Utils.isMarkdownFile(path)) { if (Utils.isMarkdownFile(path)) {
seafileAPI.getFileInfo(this.props.repoID, path).then(() => { seafileAPI.getFileInfo(this.props.repoID, path).then(() => {

View File

@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import moment from 'moment'; import moment from 'moment';
import { gettext, repoID, siteRoot, initialPath, isDir, canGenerateShareLink, canGenerateUploadLink, username } from './utils/constants'; import { gettext, repoID, siteRoot, initialPath, isDir, canGenerateShareLink, canGenerateUploadLink, username, isDocs } from './utils/constants';
import { seafileAPI } from './utils/seafile-api'; import { seafileAPI } from './utils/seafile-api';
import { Utils } from './utils/utils'; import { Utils } from './utils/utils';
import collabServer from './utils/collab-server'; import collabServer from './utils/collab-server';
@ -147,11 +147,13 @@ class Wiki extends Component {
this.updateUsedRepoTags(); this.updateUsedRepoTags();
// list draft counts and revierw counts // list draft counts and revierw counts
seafileAPI.getRepoDraftCounts(repoID).then(res => { if (isDocs) {
this.setState({ seafileAPI.getRepoDraftCounts(repoID).then(res => {
draftCounts: res.data.draft_counts, this.setState({
draftCounts: res.data.draft_counts,
});
}); });
}); }
// load side-panel data // load side-panel data
this.loadSidePanel(initialPath); this.loadSidePanel(initialPath);