Skip to content
Snippets Groups Projects
Commit 28f7e48d authored by syuilo's avatar syuilo
Browse files

improve type

parent d97fc9ce
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,7 @@ export default class extends Channel {
public static requireCredential = true;
private otherpartyId: string | null;
private otherparty?: User;
private otherparty: User | null;
private groupId: string | null;
private subCh: string;
private typers: Record<User['id'], Date> = {};
......@@ -18,9 +18,9 @@ export default class extends Channel {
@autobind
public async init(params: any) {
this.otherpartyId = params.otherparty as string;
this.otherparty = await Users.findOne({ id: this.otherpartyId });
this.groupId = params.group as string;
this.otherpartyId = params.otherparty;
this.otherparty = this.otherpartyId ? await Users.findOneOrFail({ id: this.otherpartyId }) : null;
this.groupId = params.group;
// Check joining
if (this.groupId) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment