mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 23:20:51 +00:00
Optimized module code (#2574)
This commit is contained in:
@@ -2,12 +2,13 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import RepoListView from './repo-list-view';
|
||||
import { seafileAPI } from '../../utils/seafile-api';
|
||||
import { gettext, repoID } from '../../utils/constants';
|
||||
import { gettext } from '../../utils/constants';
|
||||
import Repo from '../../models/repo';
|
||||
|
||||
import '../../css/file-chooser.css';
|
||||
|
||||
const propTypes = {
|
||||
repoID: PropTypes.string.isRequired,
|
||||
onDirentItemClick: PropTypes.func,
|
||||
onRepoItemClick: PropTypes.func,
|
||||
};
|
||||
@@ -28,6 +29,7 @@ class FileChooser extends React.Component {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
let repoID = this.props.repoID;
|
||||
seafileAPI.getRepoInfo(repoID).then(res => {
|
||||
let repo = new Repo(res.data);
|
||||
this.setState({
|
||||
|
Reference in New Issue
Block a user