mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-04 18:18:46 +00:00
Merge pull request #5110 from naturalcrit/fix-vault-crash
fix error crash with vault if server error
This commit is contained in:
@@ -74,7 +74,7 @@ const VaultPage = (props)=>{
|
||||
updateStateWithBrews([], 1);
|
||||
});
|
||||
|
||||
if(response.ok)
|
||||
if(response?.ok)
|
||||
updateStateWithBrews(response.body.brews, page);
|
||||
};
|
||||
|
||||
@@ -364,13 +364,23 @@ const VaultPage = (props)=>{
|
||||
}
|
||||
|
||||
if(error) {
|
||||
const errorText = ErrorIndex()[error.HBErrorCode.toString()] || '';
|
||||
if(error.HBErrorCode === undefined) {
|
||||
return (
|
||||
<div className='foundBrews noBrews'>
|
||||
<h3>{error.toString()}</h3>
|
||||
</div>
|
||||
)
|
||||
} else {
|
||||
|
||||
return (
|
||||
<div className='foundBrews noBrews'>
|
||||
const errorText = ErrorIndex()[error.HBErrorCode.toString()] || '';
|
||||
|
||||
return (
|
||||
<div className='foundBrews noBrews'>
|
||||
<h3>Error: {errorText}</h3>
|
||||
</div>
|
||||
);
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!brewCollection) {
|
||||
|
||||
Reference in New Issue
Block a user