mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-09-20 14:32:57 +00:00
Merge branch 'master' into new/edit/home-exctractcommonsetupsteps
This commit is contained in:
@@ -130,8 +130,8 @@ const EditPage = (props)=>{
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleGoogleClick = ()=>{
|
const handleGoogleClick = ()=>{
|
||||||
if(global.account !== currentBrew.authors[0]) {
|
if(currentBrew.authors.length > 0 && global.account?.username !== currentBrew.authors[0]) {
|
||||||
setalertOwnershipToTransfer(true);
|
setAlertOwnershipToTransfer(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!global.account?.googleId) {
|
if(!global.account?.googleId) {
|
||||||
@@ -148,7 +148,7 @@ const EditPage = (props)=>{
|
|||||||
setAlertTrashedGoogleBrew(false);
|
setAlertTrashedGoogleBrew(false);
|
||||||
setAlertNoGoogleToTransfer(false);
|
setAlertNoGoogleToTransfer(false);
|
||||||
setConfirmGoogleTransfer(false);
|
setConfirmGoogleTransfer(false);
|
||||||
setalertOwnershipToTransfer(false);
|
setAlertOwnershipToTransfer(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const toggleGoogleStorage = (e)=>{
|
const toggleGoogleStorage = (e)=>{
|
||||||
@@ -234,12 +234,11 @@ const EditPage = (props)=>{
|
|||||||
<Nav.item className='googleDriveStorage' onClick={handleGoogleClick}>
|
<Nav.item className='googleDriveStorage' onClick={handleGoogleClick}>
|
||||||
<img src={googleDriveIcon} className={saveGoogle ? '' : 'inactive'} alt='Google Drive icon' />
|
<img src={googleDriveIcon} className={saveGoogle ? '' : 'inactive'} alt='Google Drive icon' />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{alertOwnershipToTransfer && (
|
{alertOwnershipToTransfer && (
|
||||||
<div className='errorContainer'>
|
<div className='errorContainer'>
|
||||||
You must be the Owner to transfer between the Homebrewery and Google Drive!
|
You must be the Owner to transfer between the Homebrewery and Google Drive!
|
||||||
The owner of this file is {currentBrew.authors[0]}
|
The owner of this file is {currentBrew.authors[0]}.
|
||||||
|
<br></br>
|
||||||
<div className='confirm' onClick={closeAlerts}> Okay </div>
|
<div className='confirm' onClick={closeAlerts}> Okay </div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -167,6 +167,7 @@ const NewPage = (props)=>{
|
|||||||
localStorage.removeItem(BREWKEY);
|
localStorage.removeItem(BREWKEY);
|
||||||
localStorage.removeItem(STYLEKEY);
|
localStorage.removeItem(STYLEKEY);
|
||||||
localStorage.removeItem(METAKEY);
|
localStorage.removeItem(METAKEY);
|
||||||
|
window.onbeforeunload = null;
|
||||||
window.location = `/edit/${savedBrew.editId}`;
|
window.location = `/edit/${savedBrew.editId}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user