Skip to content

Commit

Permalink
fix: account added many times to extensionModalSeenBy
Browse files Browse the repository at this point in the history
  • Loading branch information
PetromirDev committed Aug 7, 2024
1 parent 89219b7 commit 3b92567
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ const ExtensionInviteCodeModal = ({

const onCloseModal = useCallback(() => {
onHideModal()
setExtensionInviteCodeModalSeenBy((prev) => [...prev, accountId])
setExtensionInviteCodeModalSeenBy((prev) => {
if (prev.includes(accountId)) return prev

return [...prev, accountId]
})
}, [accountId, onHideModal, setExtensionInviteCodeModalSeenBy])

useEffect(() => {
Expand Down

0 comments on commit 3b92567

Please sign in to comment.