mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-27 07:44:50 +00:00
fix decrypt dialog (#2673)
This commit is contained in:
@@ -15,7 +15,7 @@ class LibDecryptDialog extends React.Component {
|
||||
};
|
||||
}
|
||||
|
||||
handleSubmit = () => {
|
||||
handleSubmit = (e) => {
|
||||
let repoID = this.props.repoID;
|
||||
let password = this.state.password;
|
||||
seafileAPI.setRepoDecryptPassword(repoID, password).then(res => {
|
||||
@@ -25,8 +25,15 @@ class LibDecryptDialog extends React.Component {
|
||||
showError: true
|
||||
});
|
||||
})
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
handleKeyPress = (e) => {
|
||||
if (e.key == 'Enter') {
|
||||
this.handleSubmit(e);
|
||||
}
|
||||
};
|
||||
|
||||
handleChange = (e) => {
|
||||
this.setState({
|
||||
password: e.target.value,
|
||||
@@ -50,10 +57,11 @@ class LibDecryptDialog extends React.Component {
|
||||
<p className="error">{gettext('Wrong password')}</p>
|
||||
}
|
||||
<FormGroup>
|
||||
<Input type="password" name="password" placeholder={gettext('Password')} onChange={this.handleChange}/>
|
||||
<Input type="password" name="password" onKeyPress={this.handleKeyPress} placeholder={gettext('Password')} onChange={this.handleChange}/>
|
||||
</FormGroup>
|
||||
<FormGroup>
|
||||
<Button type="submit" value="Submit" onClick={this.handleSubmit}>{gettext('Submit')}</Button>
|
||||
</FormGroup>
|
||||
<Button onClick={this.handleSubmit}>{gettext('Submit')}</Button>
|
||||
<br />
|
||||
<p className="tip">{'* '}{gettext('The password will be kept in the server for only 1 hour.')}</p>
|
||||
</Form>
|
||||
</ModalBody>
|
||||
|
Reference in New Issue
Block a user