0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 16:22:44 +00:00

Fix state of "Request Review" button on page load

This commit is contained in:
G.Ambatte
2025-04-06 19:26:39 +12:00
parent 98edd2740f
commit cb060ae8b1
2 changed files with 6 additions and 5 deletions

View File

@@ -443,7 +443,7 @@ const EditPage = createClass({
<Meta name='robots' content='noindex, nofollow' />
{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'>
<SplitPane onDragFinish={this.handleSplitMove}>
<Editor

View File

@@ -5,13 +5,14 @@ import Dialog from '../../../../components/dialog.jsx';
function LockNotification(props) {
props = {
shareId : 0,
disableLock : ()=>{},
lock : {},
shareId : 0,
disableLock : ()=>{},
lock : {},
reviewRequested : false,
...props
};
const [reviewState, setReviewState] = React.useState(false);
const [reviewState, setReviewState] = React.useState(props.reviewRequested);
const removeLock = async ()=>{
await request.put(`/admin/lock/review/request/${props.shareId}`)