summaryrefslogtreecommitdiffstats
path: root/ui/src/components/post-listing.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/components/post-listing.tsx')
-rw-r--r--ui/src/components/post-listing.tsx9
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx
index fa2a078e..418fe7b4 100644
--- a/ui/src/components/post-listing.tsx
+++ b/ui/src/components/post-listing.tsx
@@ -33,6 +33,7 @@ import {
setupTippy,
hostname,
previewLines,
+ toast,
} from '../utils';
import { i18n } from '../i18next';
@@ -1032,6 +1033,10 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
}
handlePostLike(i: PostListing) {
+ if (!UserService.Instance.user) {
+ this.context.router.history.push(`/login`);
+ }
+
let new_vote = i.state.my_vote == 1 ? 0 : 1;
if (i.state.my_vote == 1) {
@@ -1059,6 +1064,10 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
}
handlePostDisLike(i: PostListing) {
+ if (!UserService.Instance.user) {
+ this.context.router.history.push(`/login`);
+ }
+
let new_vote = i.state.my_vote == -1 ? 0 : -1;
if (i.state.my_vote == 1) {