fix comment editting if not logged in

This commit is contained in:
keyan 2021-08-10 18:09:27 -05:00
parent b4be2c613b
commit fd79b92b9b
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ export default function Comment ({ item, children, replyOpen, includeParent, cac
const ref = useRef(null)
const router = useRouter()
const me = useMe()
const mine = me.id === item.user.id
const mine = me?.id === item.user.id
const editThreshold = new Date(item.createdAt).getTime() + 10 * 60000
const [canEdit, setCanEdit] =
useState(mine && (Date.now() < editThreshold))