"eslint": "^7.16.0",
"eslint-plugin-jane": "^9.0.6",
"husky": "^4.3.6",
- "lemmy-js-client": "1.0.17-beta6",
+ "lemmy-js-client": "0.9.0-rc.12",
"lint-staged": "^10.5.3",
"mini-css-extract-plugin": "^1.3.3",
"node-fetch": "^2.6.1",
let form: EditComment = {
content,
form_id: this.state.formId,
- edit_id: node.comment_view.comment.id,
+ comment_id: node.comment_view.comment.id,
auth: authField(),
};
WebSocketService.Instance.send(wsClient.editComment(form));
handleDeleteClick(i: CommentNode) {
let comment = i.props.node.comment_view.comment;
let deleteForm: DeleteComment = {
- edit_id: comment.id,
+ comment_id: comment.id,
deleted: !comment.deleted,
auth: authField(),
};
handleModRemoveSubmit(i: CommentNode) {
let comment = i.props.node.comment_view.comment;
let form: RemoveComment = {
- edit_id: comment.id,
+ comment_id: comment.id,
removed: !comment.removed,
reason: i.state.removeReason,
auth: authField(),
if (i.props.community_view) {
let form: EditCommunity = {
...i.state.communityForm,
- edit_id: i.props.community_view.community.id,
+ community_id: i.props.community_view.community.id,
};
WebSocketService.Instance.send(wsClient.editCommunity(form));
} else {
username: undefined,
password: undefined,
password_verify: undefined,
- admin: false,
show_nsfw: false,
captcha_uuid: undefined,
captcha_answer: undefined,
if (i.props.post_view) {
let form: EditPost = {
...i.state.postForm,
- edit_id: i.props.post_view.post.id,
+ post_id: i.props.post_view.post.id,
};
WebSocketService.Instance.send(wsClient.editPost(form));
} else {
handleDeleteClick(i: PostListing) {
let deleteForm: DeletePost = {
- edit_id: i.props.post_view.post.id,
+ post_id: i.props.post_view.post.id,
deleted: !i.props.post_view.post.deleted,
auth: authField(),
};
handleModRemoveSubmit(i: PostListing) {
event.preventDefault();
let form: RemovePost = {
- edit_id: i.props.post_view.post.id,
+ post_id: i.props.post_view.post.id,
removed: !i.props.post_view.post.removed,
reason: i.state.removeReason,
auth: authField(),
handleModLock(i: PostListing) {
let form: LockPost = {
- edit_id: i.props.post_view.post.id,
+ post_id: i.props.post_view.post.id,
locked: !i.props.post_view.post.locked,
auth: authField(),
};
handleModSticky(i: PostListing) {
let form: StickyPost = {
- edit_id: i.props.post_view.post.id,
+ post_id: i.props.post_view.post.id,
stickied: !i.props.post_view.post.stickied,
auth: authField(),
};
event.preventDefault();
if (i.props.privateMessage) {
let form: EditPrivateMessage = {
- edit_id: i.props.privateMessage.private_message.id,
+ private_message_id: i.props.privateMessage.private_message.id,
content: i.state.privateMessageForm.content,
auth: authField(),
};
handleDeleteClick(i: PrivateMessage) {
let form: DeletePrivateMessage = {
- edit_id: i.props.private_message_view.private_message.id,
+ private_message_id: i.props.private_message_view.private_message.id,
deleted: !i.props.private_message_view.private_message.deleted,
auth: authField(),
};
handleMarkRead(i: PrivateMessage) {
let form: MarkPrivateMessageAsRead = {
- edit_id: i.props.private_message_view.private_message.id,
+ private_message_id: i.props.private_message_view.private_message.id,
read: !i.props.private_message_view.private_message.read,
auth: authField(),
};
username: undefined,
password: undefined,
password_verify: undefined,
- admin: true,
show_nsfw: true,
// The first admin signup doesn't need a captcha
captcha_uuid: '',
handleDeleteClick(i: Sidebar, event: any) {
event.preventDefault();
let deleteForm: DeleteCommunity = {
- edit_id: i.props.community_view.community.id,
+ community_id: i.props.community_view.community.id,
deleted: !i.props.community_view.community.deleted,
auth: authField(),
};
handleModRemoveSubmit(i: Sidebar, event: any) {
event.preventDefault();
let removeForm: RemoveCommunity = {
- edit_id: i.props.community_view.community.id,
+ community_id: i.props.community_view.community.id,
removed: !i.props.community_view.community.removed,
reason: i.state.removeReason,
expires: getUnixTime(i.state.removeExpires),
-import { User_ } from 'lemmy-js-client';
+import { UserSafeSettings } from 'lemmy-js-client';
import { Helmet } from 'inferno-helmet';
import { Component } from 'inferno';
interface Props {
- user: User_ | undefined;
+ user: UserSafeSettings | undefined;
}
export class Theme extends Component<Props> {
// Only fetch the data if coming from another route
if (this.isoData.path == this.context.router.route.match.url) {
this.state.userRes = this.isoData.routeData[0];
- this.state.userRes.user_view =
- this.state.userRes.user_view || this.state.userRes.user_view_dangerous;
this.setUserInfo();
this.state.loading = false;
} else {
// TODO this might need to get abstracted
let data = wsJsonToRes<GetUserDetailsResponse>(msg).data;
this.state.userRes = data;
- this.state.userRes.user_view =
- this.state.userRes.user_view || this.state.userRes.user_view_dangerous;
this.setUserInfo();
this.state.loading = false;
this.setState(this.state);
// import Cookies from 'js-cookie';
import IsomorphicCookie from 'isomorphic-cookie';
-import { User_, LoginResponse } from 'lemmy-js-client';
+import { UserSafeSettings, LoginResponse } from 'lemmy-js-client';
import jwt_decode from 'jwt-decode';
import { Subject, BehaviorSubject } from 'rxjs';
export class UserService {
private static _instance: UserService;
- public user: User_;
+ public user: UserSafeSettings;
public claims: Claims;
public jwtSub: Subject<string> = new Subject<string>();
public unreadCountSub: BehaviorSubject<number> = new BehaviorSubject<number>(
import {
UserOperation,
CommentView,
- User_,
+ UserSafeSettings,
SortType,
ListingType,
SearchType,
}
export function canMod(
- user: User_,
+ user: UserSafeSettings,
modIds: number[],
creator_id: number,
onSelf: boolean = false
dependencies:
invert-kv "^1.0.0"
-lemmy-js-client@1.0.17-beta6:
- version "1.0.17-beta6"
- resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-1.0.17-beta6.tgz#afe1e1da13172a161c4d976b1ee58fe81eb22829"
- integrity sha512-+oX7J7wht8nH4a5NQngK1GNner3TDv6ZOhQQVI5KcK7vynVVIcgveC5KBJArHBAl5acXpLs3Khmx0ZEb+sErJA==
+lemmy-js-client@0.9.0-rc.12:
+ version "0.9.0-rc.12"
+ resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.9.0-rc.12.tgz#991d31c4ef89b9bd4088a17c60b6cbaac997df41"
+ integrity sha512-SeCw9wjU89Zm4YWhr+neHC2XvqoqzJg2e42sFEgcDmnQxpPt2sND9Udu+tjGXatbz0tCu6ybGmpR5M0QT4xx9Q==
leven@^3.1.0:
version "3.1.0"