From f8557bb073c5a3dcc18ff10a9ad79133cdc64c0d Mon Sep 17 00:00:00 2001 From: Chris Blanchard Date: Sat, 26 Sep 2015 12:15:24 +0100 Subject: [PATCH] Add admin 'assume user' button --- lib/react/user.jsx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/react/user.jsx b/lib/react/user.jsx index bcc6726..fbddb2e 100644 --- a/lib/react/user.jsx +++ b/lib/react/user.jsx @@ -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 + } + } +}); \ No newline at end of file