fix passwordJWTToken ref usage

This commit is contained in:
Abhinav 2022-02-26 12:36:35 +05:30
parent c6dd93270d
commit 8595b0a04a

View file

@ -153,7 +153,7 @@ export default function PublicCollectionGallery() {
// check if we need to prompt user for the password // check if we need to prompt user for the password
if ( if (
(collection?.publicURLs?.[0]?.passwordEnabled ?? false) && (collection?.publicURLs?.[0]?.passwordEnabled ?? false) &&
!passwordJWTToken !passwordJWTToken.current
) { ) {
setIsPasswordProtected(true); setIsPasswordProtected(true);
} else { } else {
@ -244,7 +244,7 @@ export default function PublicCollectionGallery() {
if (errorMessage && !loading) { if (errorMessage && !loading) {
return <Container>{errorMessage}</Container>; return <Container>{errorMessage}</Container>;
} }
if (isPasswordProtected && !passwordJWTToken && !loading) { if (isPasswordProtected && !passwordJWTToken.current && !loading) {
return ( return (
<Container> <Container>
<Card style={{ width: '332px' }} className="text-center"> <Card style={{ width: '332px' }} className="text-center">