mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-16 07:58:44 +00:00
fix error crash with vault if server error
This commit is contained in:
@@ -41,7 +41,7 @@ const errorIndex = (props)=>{
|
|||||||
## We can't find this brew in Google Drive!
|
## We can't find this brew in Google Drive!
|
||||||
|
|
||||||
This file was saved on Google Drive, but this link doesn't work anymore.
|
This file was saved on Google Drive, but this link doesn't work anymore.
|
||||||
${props.brew.authors?.length > 0
|
${props?.brew?.authors?.length > 0
|
||||||
? `Note that this brew belongs to the Homebrewery account **${props.brew.authors[0]}**,
|
? `Note that this brew belongs to the Homebrewery account **${props.brew.authors[0]}**,
|
||||||
${props.brew.account
|
${props.brew.account
|
||||||
? `which is
|
? `which is
|
||||||
|
|||||||
@@ -74,8 +74,11 @@ const VaultPage = (props)=>{
|
|||||||
updateStateWithBrews([], 1);
|
updateStateWithBrews([], 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
if(response.ok)
|
if(response?.ok)
|
||||||
updateStateWithBrews(response.body.brews, page);
|
updateStateWithBrews(response.body.brews, page);
|
||||||
|
else {
|
||||||
|
console.log('response: ', response);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadTotal = async (title, author, v3, legacy)=>{
|
const loadTotal = async (title, author, v3, legacy)=>{
|
||||||
@@ -364,13 +367,23 @@ const VaultPage = (props)=>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(error) {
|
if(error) {
|
||||||
const errorText = ErrorIndex()[error.HBErrorCode.toString()] || '';
|
if(error.HBErrorCode === undefined) {
|
||||||
|
return (
|
||||||
|
<div className='foundBrews noBrews'>
|
||||||
|
<h3>{error.toString()}</h3>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
|
||||||
return (
|
const errorText = ErrorIndex()[error.HBErrorCode.toString()] || '';
|
||||||
<div className='foundBrews noBrews'>
|
|
||||||
|
return (
|
||||||
|
<div className='foundBrews noBrews'>
|
||||||
<h3>Error: {errorText}</h3>
|
<h3>Error: {errorText}</h3>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!brewCollection) {
|
if(!brewCollection) {
|
||||||
|
|||||||
Reference in New Issue
Block a user