mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2025-01-19 16:11:01 +00:00
Add admin 'assume user' button
This commit is contained in:
parent
1c0f001e4a
commit
f8557bb073
1 changed files with 24 additions and 0 deletions
|
@ -226,3 +226,27 @@ var CurrentUser = React.createClass({
|
|||
}
|
||||
});
|
||||
|
||||
var AssumeUserIdButton = React.createClass({
|
||||
assumeId(e) {
|
||||
e.preventDefault();
|
||||
if (this.props.gatherer) {
|
||||
socket.emit("users:authorize", {
|
||||
id: this.props.gatherer.id
|
||||
});
|
||||
// Refresh Gather list
|
||||
setTimeout(() => {
|
||||
socket.emit("gather:refresh");
|
||||
}, 5000);
|
||||
}
|
||||
},
|
||||
|
||||
render() {
|
||||
let currentUser = this.props.currentUser;
|
||||
let gatherer = this.props.gatherer;
|
||||
if (currentUser && gatherer) {
|
||||
return <button
|
||||
className="btn btn-xs btn-danger"
|
||||
onClick={this.assumeId}>Assume User ID</button>
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Reference in a new issue