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
if (
(collection?.publicURLs?.[0]?.passwordEnabled ?? false) &&
!passwordJWTToken
!passwordJWTToken.current
) {
setIsPasswordProtected(true);
} else {
@ -244,7 +244,7 @@ export default function PublicCollectionGallery() {
if (errorMessage && !loading) {
return <Container>{errorMessage}</Container>;
}
if (isPasswordProtected && !passwordJWTToken && !loading) {
if (isPasswordProtected && !passwordJWTToken.current && !loading) {
return (
<Container>
<Card style={{ width: '332px' }} className="text-center">