"eslint": "^7.8.1",
"eslint-plugin-jane": "^9.0.0",
"husky": "^4.3.0",
- "lemmy-js-client": "^1.0.11",
+ "lemmy-js-client": "^1.0.13",
"lint-staged": "^10.3.0",
"mini-css-extract-plugin": "^0.11.1",
"node-fetch": "^2.6.1",
this.state.loading = false;
}
this.setState(this.state);
+ WebSocketService.Instance.communityJoin({
+ community_id: data.community.id,
+ });
} else if (
res.op == UserOperation.EditCommunity ||
res.op == UserOperation.DeleteCommunity ||
WebSocketService.Instance.listCommunities(listCommunitiesForm);
}
+ componentDidMount() {
+ WebSocketService.Instance.communityJoin({ community_id: 0 });
+ }
+
componentWillUnmount() {
if (isBrowser()) {
this.subscription.unsubscribe();
}
componentDidMount() {
+ WebSocketService.Instance.postJoin({ post_id: this.state.postId });
autosize(document.querySelectorAll('textarea'));
}
SiteConfigForm,
MarkAllAsReadForm,
WebSocketJsonResponse,
+ CommunityJoinForm,
+ PostJoinForm,
} from 'lemmy-js-client';
import { UserService } from './';
import { i18n } from '../i18next';
this.ws = new ReconnectingWebSocket(wsUri, [], this.wsOptions);
let firstConnect = true;
- this.subject = Observable.create((obs: any) => {
+ this.subject = new Observable((obs: any) => {
this.ws.onmessage = e => {
obs.next(JSON.parse(e.data));
};
this.ws.send(this.client.userJoin(form));
}
+ public postJoin(form: PostJoinForm) {
+ this.ws.send(this.client.postJoin(form));
+ }
+
+ public communityJoin(form: CommunityJoinForm) {
+ this.ws.send(this.client.communityJoin(form));
+ }
+
public login(form: LoginForm) {
this.ws.send(this.client.login(form));
}
dependencies:
invert-kv "^1.0.0"
-lemmy-js-client@^1.0.11:
- version "1.0.11"
- resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-1.0.11.tgz#f6ccdd5f4bf60c9ec49a4337c92d91933c0d00c2"
- integrity sha512-bMvCKcP76YpSYhVSX0hGnhf9DQWpu7j4UQG2ektbpsmTi+yA4JiZKsLQXwgQH7hty42EHV0ZJVBNUpqlKnGFrA==
+lemmy-js-client@^1.0.13:
+ version "1.0.13"
+ resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-1.0.13.tgz#d0e1246129ade295faeec1fb4b2c7397d6947a19"
+ integrity sha512-Xz87cCswi/2pbDdApw9JIy8bDWRFGiGWO6IhehTytOAzf36dr4GYgsjTQTLjBX+s+BNYr8hE0+Sz4g9c+ynoJg==
leven@^3.1.0:
version "3.1.0"