mirror of
https://github.com/stoatchat/javascript-client-sdk.git
synced 2026-07-21 04:25:27 -04:00
refactor: clean up relationship fix
This commit is contained in:
@@ -671,13 +671,9 @@ export class WebSocketClient {
|
||||
}
|
||||
|
||||
case "UserRelationship": {
|
||||
packet.status = packet.user.relationship!;
|
||||
const user = this.client.users.get(packet.user._id);
|
||||
if (user) {
|
||||
user.update({
|
||||
...packet.user,
|
||||
relationship: packet.status,
|
||||
});
|
||||
user.update(packet.user);
|
||||
} else {
|
||||
this.client.users.createObj(packet.user);
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ export type ClientboundNotification =
|
||||
data: Partial<User>;
|
||||
clear?: FieldsUser[];
|
||||
}
|
||||
| { type: "UserRelationship"; user: User; status: RelationshipStatus }
|
||||
| { type: "UserRelationship"; user: User }
|
||||
| { type: "UserPresence"; id: string; online: boolean }
|
||||
| {
|
||||
type: "UserSettingsUpdate";
|
||||
|
||||
Reference in New Issue
Block a user