mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 23:48:47 +00:00
repair code bug (#4303)
This commit is contained in:
@@ -105,12 +105,12 @@ class ShareToGroup extends React.Component {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
|
options: [],
|
||||||
selectedOption: null,
|
selectedOption: null,
|
||||||
errorMsg: [],
|
errorMsg: [],
|
||||||
permission: 'rw',
|
permission: 'rw',
|
||||||
sharedItems: []
|
sharedItems: []
|
||||||
};
|
};
|
||||||
this.options = [];
|
|
||||||
this.permissions = [];
|
this.permissions = [];
|
||||||
let { itemType, isRepoOwner } = props;
|
let { itemType, isRepoOwner } = props;
|
||||||
if (itemType === 'library') {
|
if (itemType === 'library') {
|
||||||
@@ -134,14 +134,15 @@ class ShareToGroup extends React.Component {
|
|||||||
|
|
||||||
loadOptions = () => {
|
loadOptions = () => {
|
||||||
seafileAPI.shareableGroups().then((res) => {
|
seafileAPI.shareableGroups().then((res) => {
|
||||||
this.options = [];
|
let options = [];
|
||||||
for (let i = 0 ; i < res.data.length; i++) {
|
for (let i = 0 ; i < res.data.length; i++) {
|
||||||
let obj = {};
|
let obj = {};
|
||||||
obj.value = res.data[i].name;
|
obj.value = res.data[i].name;
|
||||||
obj.id = res.data[i].id;
|
obj.id = res.data[i].id;
|
||||||
obj.label = res.data[i].name;
|
obj.label = res.data[i].name;
|
||||||
this.options.push(obj);
|
options.push(obj);
|
||||||
}
|
}
|
||||||
|
this.setState({options: options});
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
let errMessage = Utils.getErrorMsg(error);
|
let errMessage = Utils.getErrorMsg(error);
|
||||||
toaster.danger(errMessage);
|
toaster.danger(errMessage);
|
||||||
@@ -303,7 +304,7 @@ class ShareToGroup extends React.Component {
|
|||||||
<Select
|
<Select
|
||||||
isMulti
|
isMulti
|
||||||
onChange={this.handleSelectChange}
|
onChange={this.handleSelectChange}
|
||||||
options={this.options}
|
options={this.state.options}
|
||||||
placeholder={gettext('Select groups...')}
|
placeholder={gettext('Select groups...')}
|
||||||
components={makeAnimated()}
|
components={makeAnimated()}
|
||||||
maxMenuHeight={200}
|
maxMenuHeight={200}
|
||||||
|
Reference in New Issue
Block a user