-import { Component, linkEvent } from 'inferno';
-import { Subscription } from 'rxjs';
+import { Component, linkEvent } from "inferno";
+import { Subscription } from "rxjs";
import {
UserOperation,
CommentView,
PrivateMessageResponse,
SiteView,
UserMentionView,
-} from 'lemmy-js-client';
-import { WebSocketService, UserService } from '../services';
+} from "lemmy-js-client";
+import { WebSocketService, UserService } from "../services";
import {
wsJsonToRes,
fetchLimit,
wsUserOp,
wsClient,
authField,
-} from '../utils';
-import { CommentNodes } from './comment-nodes';
-import { PrivateMessage } from './private-message';
-import { HtmlTags } from './html-tags';
-import { SortSelect } from './sort-select';
-import { Icon, Spinner } from './icon';
-import { i18n } from '../i18next';
-import { InitialFetchRequest } from 'shared/interfaces';
+} from "../utils";
+import { CommentNodes } from "./comment-nodes";
+import { PrivateMessage } from "./private-message";
+import { HtmlTags } from "./html-tags";
+import { SortSelect } from "./sort-select";
+import { Icon, Spinner } from "./icon";
+import { i18n } from "../i18next";
+import { InitialFetchRequest } from "shared/interfaces";
enum UnreadOrAll {
Unread,
this.handleSortChange = this.handleSortChange.bind(this);
if (!UserService.Instance.user && isBrowser()) {
- toast(i18n.t('not_logged_in'), 'danger');
+ toast(i18n.t("not_logged_in"), "danger");
this.context.router.history.push(`/login`);
}
}
get documentTitle(): string {
- return `@${UserService.Instance.user.name} ${i18n.t('inbox')} - ${
+ return `@${UserService.Instance.user.name} ${i18n.t("inbox")} - ${
this.state.site_view.site.name
}`;
}
path={this.context.router.route.match.url}
/>
<h5 class="mb-1">
- {i18n.t('inbox')}
+ {i18n.t("inbox")}
<small>
<a
href={`/feeds/inbox/${UserService.Instance.auth}.xml`}
role="button"
onClick={linkEvent(this, this.markAllAsRead)}
>
- {i18n.t('mark_all_as_read')}
+ {i18n.t("mark_all_as_read")}
</span>
</li>
</ul>
<div class="btn-group btn-group-toggle flex-wrap mb-2">
<label
className={`btn btn-outline-secondary pointer
- ${this.state.unreadOrAll == UnreadOrAll.Unread && 'active'}
+ ${this.state.unreadOrAll == UnreadOrAll.Unread && "active"}
`}
>
<input
checked={this.state.unreadOrAll == UnreadOrAll.Unread}
onChange={linkEvent(this, this.handleUnreadOrAllChange)}
/>
- {i18n.t('unread')}
+ {i18n.t("unread")}
</label>
<label
className={`btn btn-outline-secondary pointer
- ${this.state.unreadOrAll == UnreadOrAll.All && 'active'}
+ ${this.state.unreadOrAll == UnreadOrAll.All && "active"}
`}
>
<input
checked={this.state.unreadOrAll == UnreadOrAll.All}
onChange={linkEvent(this, this.handleUnreadOrAllChange)}
/>
- {i18n.t('all')}
+ {i18n.t("all")}
</label>
</div>
);
<div class="btn-group btn-group-toggle flex-wrap mb-2">
<label
className={`btn btn-outline-secondary pointer
- ${this.state.messageType == MessageType.All && 'active'}
+ ${this.state.messageType == MessageType.All && "active"}
`}
>
<input
checked={this.state.messageType == MessageType.All}
onChange={linkEvent(this, this.handleMessageTypeChange)}
/>
- {i18n.t('all')}
+ {i18n.t("all")}
</label>
<label
className={`btn btn-outline-secondary pointer
- ${this.state.messageType == MessageType.Replies && 'active'}
+ ${this.state.messageType == MessageType.Replies && "active"}
`}
>
<input
checked={this.state.messageType == MessageType.Replies}
onChange={linkEvent(this, this.handleMessageTypeChange)}
/>
- {i18n.t('replies')}
+ {i18n.t("replies")}
</label>
<label
className={`btn btn-outline-secondary pointer
- ${this.state.messageType == MessageType.Mentions && 'active'}
+ ${this.state.messageType == MessageType.Mentions && "active"}
`}
>
<input
checked={this.state.messageType == MessageType.Mentions}
onChange={linkEvent(this, this.handleMessageTypeChange)}
/>
- {i18n.t('mentions')}
+ {i18n.t("mentions")}
</label>
<label
className={`btn btn-outline-secondary pointer
- ${this.state.messageType == MessageType.Messages && 'active'}
+ ${this.state.messageType == MessageType.Messages && "active"}
`}
>
<input
checked={this.state.messageType == MessageType.Messages}
onChange={linkEvent(this, this.handleMessageTypeChange)}
/>
- {i18n.t('messages')}
+ {i18n.t("messages")}
</label>
</div>
);
class="btn btn-secondary mr-1"
onClick={linkEvent(this, this.prevPage)}
>
- {i18n.t('prev')}
+ {i18n.t("prev")}
</button>
)}
{this.unreadCount() > 0 && (
class="btn btn-secondary"
onClick={linkEvent(this, this.nextPage)}
>
- {i18n.t('next')}
+ {i18n.t("next")}
</button>
)}
</div>
let op = wsUserOp(msg);
console.log(msg);
if (msg.error) {
- toast(i18n.t(msg.error), 'danger');
+ toast(i18n.t(msg.error), "danger");
return;
} else if (msg.reconnect) {
this.refetch();
this.setState(this.state);
} else if (data.comment_view.creator.id == UserService.Instance.user.id) {
// TODO this seems wrong, you should be using form_id
- toast(i18n.t('reply_sent'));
+ toast(i18n.t("reply_sent"));
}
} else if (op == UserOperation.CreatePrivateMessage) {
let data = wsJsonToRes<PrivateMessageResponse>(msg).data;