Skip to content

Commit 71b4ea1

Browse files
committed
Update index.vue
1 parent 1cb8b26 commit 71b4ea1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

resources/js/pages/v/index.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,10 @@ watch(isVideoLoaded, (newVal) => {
762762
});
763763
764764
const likePost = async () => {
765+
if (!authStore.isAuthenticated) {
766+
authStore.openAuthModal("login");
767+
return;
768+
}
765769
try {
766770
await videoStore.likeVideo(currentVideo.value?.id);
767771
} catch (error) {
@@ -770,6 +774,10 @@ const likePost = async () => {
770774
};
771775
772776
const unlikePost = async () => {
777+
if (!authStore.isAuthenticated) {
778+
authStore.openAuthModal("login");
779+
return;
780+
}
773781
try {
774782
await videoStore.unlikeVideo(currentVideo.value?.id);
775783
} catch (error) {

0 commit comments

Comments
 (0)