mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-08-06 08:57:38 +00:00
fix the issue
This commit is contained in:
@@ -71,6 +71,7 @@ const EditPage = (props)=>{
|
|||||||
const [alertTrashedGoogleBrew, setAlertTrashedGoogleBrew] = useState(props.brew.trashed);
|
const [alertTrashedGoogleBrew, setAlertTrashedGoogleBrew] = useState(props.brew.trashed);
|
||||||
const [alertLoginToTransfer, setAlertLoginToTransfer] = useState(false);
|
const [alertLoginToTransfer, setAlertLoginToTransfer] = useState(false);
|
||||||
const [confirmGoogleTransfer, setConfirmGoogleTransfer] = useState(false);
|
const [confirmGoogleTransfer, setConfirmGoogleTransfer] = useState(false);
|
||||||
|
const [notOwnerToTransfer, setNotOwnerToTransfer] = useState(false);
|
||||||
const [autoSaveEnabled, setAutoSaveEnabled] = useState(true);
|
const [autoSaveEnabled, setAutoSaveEnabled] = useState(true);
|
||||||
const [warnUnsavedChanges, setWarnUnsavedChanges] = useState(true);
|
const [warnUnsavedChanges, setWarnUnsavedChanges] = useState(true);
|
||||||
|
|
||||||
@@ -162,6 +163,9 @@ const EditPage = (props)=>{
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleGoogleClick = ()=>{
|
const handleGoogleClick = ()=>{
|
||||||
|
if(global.account !== brew.authors[0]) {
|
||||||
|
setNotOwnerToTransfer(true);
|
||||||
|
}
|
||||||
if(!global.account?.googleId) {
|
if(!global.account?.googleId) {
|
||||||
setAlertLoginToTransfer(true);
|
setAlertLoginToTransfer(true);
|
||||||
return;
|
return;
|
||||||
@@ -176,6 +180,7 @@ const EditPage = (props)=>{
|
|||||||
setAlertTrashedGoogleBrew(false);
|
setAlertTrashedGoogleBrew(false);
|
||||||
setAlertLoginToTransfer(false);
|
setAlertLoginToTransfer(false);
|
||||||
setConfirmGoogleTransfer(false);
|
setConfirmGoogleTransfer(false);
|
||||||
|
setNotOwnerToTransfer(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const toggleGoogleStorage = ()=>{
|
const toggleGoogleStorage = ()=>{
|
||||||
@@ -271,9 +276,19 @@ const EditPage = (props)=>{
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{notOwnerToTransfer && (
|
||||||
|
<div className='errorContainer' onClick={closeAlerts}>
|
||||||
|
You must be the Owner to transfer between the Homebrewery and Google Drive!
|
||||||
|
<a target='_blank' rel='noopener noreferrer' href={`https://www.naturalcrit.com/login?redirect=${window.location.href}`}>
|
||||||
|
<div className='confirm'> Sign In </div>
|
||||||
|
</a>
|
||||||
|
<div className='deny'> Not Now </div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{alertLoginToTransfer && (
|
{alertLoginToTransfer && (
|
||||||
<div className='errorContainer' onClick={closeAlerts}>
|
<div className='errorContainer' onClick={closeAlerts}>
|
||||||
You must be signed in to a Google account to transfer between the homebrewery and Google Drive!
|
You must be signed in to a Google account to transfer between the Homebrewery and Google Drive!
|
||||||
<a target='_blank' rel='noopener noreferrer' href={`https://www.naturalcrit.com/login?redirect=${window.location.href}`}>
|
<a target='_blank' rel='noopener noreferrer' href={`https://www.naturalcrit.com/login?redirect=${window.location.href}`}>
|
||||||
<div className='confirm'> Sign In </div>
|
<div className='confirm'> Sign In </div>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user