diff --git a/components/video/CommentPost.vue b/components/video/CommentPost.vue index 56fbb18..e3d8ffd 100644 --- a/components/video/CommentPost.vue +++ b/components/video/CommentPost.vue @@ -17,6 +17,9 @@ const inputEl = ref(null) const auth = useAuth() // Whether logged in const inputContent = ref('') // Content const commentParentId = computed(() => props.videoId ?? props.playlistId ?? null) // id +const isLogin = (await auth).isLogin +const route = useRoute() +const enablePreview = ref(false) // Comment posting status and error message status const postingComment = ref(false) @@ -81,10 +84,16 @@ function onReset() { inputEl.value.innerHTML = '' inputContent.value = '' } + +function togglePreview() { + if (!inputEl.value) + return + enablePreview.value = !enablePreview.value +}