From: Dessalines Date: Tue, 15 Dec 2020 23:43:35 +0000 (-0500) Subject: Redirect inbox to login. Fixes #105 X-Git-Url: http://these/git/readmes/%7BrepoUrl%7D?a=commitdiff_plain;h=edcaf00486de704129170e71bdeacc93a627d245;p=lemmy-ui.git Redirect inbox to login. Fixes #105 --- diff --git a/src/shared/components/inbox.tsx b/src/shared/components/inbox.tsx index 70feb4b..04eb043 100644 --- a/src/shared/components/inbox.tsx +++ b/src/shared/components/inbox.tsx @@ -87,6 +87,11 @@ export class Inbox extends Component { this.state = this.emptyState; this.handleSortChange = this.handleSortChange.bind(this); + if (!UserService.Instance.user && isBrowser()) { + toast(i18n.t('not_logged_in'), 'danger'); + this.context.router.history.push(`/login`); + } + this.parseMessage = this.parseMessage.bind(this); this.subscription = wsSubscribe(this.parseMessage);