Skip to content

Commit

Permalink
Differentiate between Edit and Share messages
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Ambatte committed Apr 20, 2024
1 parent b4b4fbe commit 4c6953a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/homebrew/pages/editPage/editPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ const EditPage = createClass({

<div className='content'>
{this.state.displayLockMessage ?
<LockNotification message={this.props.brew.lock.message} disableLock={()=>this.setState({ displayLockMessage: false })}/>
<LockNotification message={this.props.brew.lock.editMessage} disableLock={()=>this.setState({ displayLockMessage: false })}/>
:
<SplitPane onDragFinish={this.handleSplitMove} ref='pane'>
<Editor
Expand Down
6 changes: 3 additions & 3 deletions server/homebrew.api.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const api = {
stub = stub?.toObject();

if(stub?.lock?.locked && accessType != 'edit') {
throw { HBErrorCode: '100', code: stub.lock.code, message: stub.lock.message, brewId: stub.shareId, brewTitle: stub.title };
throw { HBErrorCode: '100', code: stub.lock.code, message: stub.lock.shareMessage, brewId: stub.shareId, brewTitle: stub.title };
}

// If there is a google id, try to find the google brew
Expand Down Expand Up @@ -83,9 +83,9 @@ const api = {
if(accessType === 'edit' && (authorsExist && !(isAuthor || isInvited))) {
const accessError = { name: 'Access Error', status: 401 };
if(req.account){
throw { ...accessError, message: 'User is not an Author', HBErrorCode: '03', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId};
throw { ...accessError, message: 'User is not an Author', HBErrorCode: '03', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId };
}
throw { ...accessError, message: 'User is not logged in', HBErrorCode: '04', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId};
throw { ...accessError, message: 'User is not logged in', HBErrorCode: '04', authors: stub.authors, brewTitle: stub.title, shareId: stub.shareId };
}

// If after all of that we still don't have a brew, throw an exception
Expand Down

0 comments on commit 4c6953a

Please sign in to comment.