fix comment editting if not logged in
This commit is contained in:
parent
b4be2c613b
commit
fd79b92b9b
|
@ -45,7 +45,7 @@ export default function Comment ({ item, children, replyOpen, includeParent, cac
|
||||||
const ref = useRef(null)
|
const ref = useRef(null)
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const me = useMe()
|
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 editThreshold = new Date(item.createdAt).getTime() + 10 * 60000
|
||||||
const [canEdit, setCanEdit] =
|
const [canEdit, setCanEdit] =
|
||||||
useState(mine && (Date.now() < editThreshold))
|
useState(mine && (Date.now() < editThreshold))
|
||||||
|
|
Loading…
Reference in New Issue