mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-09 13:42:38 +00:00
Fix state of "Request Review" button on page load
This commit is contained in:
@@ -443,7 +443,7 @@ const EditPage = createClass({
|
|||||||
<Meta name='robots' content='noindex, nofollow' />
|
<Meta name='robots' content='noindex, nofollow' />
|
||||||
{this.renderNavbar()}
|
{this.renderNavbar()}
|
||||||
|
|
||||||
{this.props.brew.lock && <LockNotification shareId={this.props.brew.shareId} message={this.props.brew.lock.editMessage} />}
|
{this.props.brew.lock && <LockNotification shareId={this.props.brew.shareId} message={this.props.brew.lock.editMessage} reviewRequested={this.props.brew.lock.reviewRequested} />}
|
||||||
<div className='content'>
|
<div className='content'>
|
||||||
<SplitPane onDragFinish={this.handleSplitMove}>
|
<SplitPane onDragFinish={this.handleSplitMove}>
|
||||||
<Editor
|
<Editor
|
||||||
|
|||||||
@@ -5,13 +5,14 @@ import Dialog from '../../../../components/dialog.jsx';
|
|||||||
|
|
||||||
function LockNotification(props) {
|
function LockNotification(props) {
|
||||||
props = {
|
props = {
|
||||||
shareId : 0,
|
shareId : 0,
|
||||||
disableLock : ()=>{},
|
disableLock : ()=>{},
|
||||||
lock : {},
|
lock : {},
|
||||||
|
reviewRequested : false,
|
||||||
...props
|
...props
|
||||||
};
|
};
|
||||||
|
|
||||||
const [reviewState, setReviewState] = React.useState(false);
|
const [reviewState, setReviewState] = React.useState(props.reviewRequested);
|
||||||
|
|
||||||
const removeLock = async ()=>{
|
const removeLock = async ()=>{
|
||||||
await request.put(`/admin/lock/review/request/${props.shareId}`)
|
await request.put(`/admin/lock/review/request/${props.shareId}`)
|
||||||
|
|||||||
Reference in New Issue
Block a user