GetUserDetailsForm,
SortType,
WebSocketJsonResponse,
-} from '../interfaces';
+} from 'lemmy-js-client';
import { WebSocketService } from '../services';
import {
capitalizeFirstLetter,
this.state.privateMessageForm.recipient_id = this.props.params.recipient_id;
let form: GetUserDetailsForm = {
user_id: this.state.privateMessageForm.recipient_id,
- sort: SortType[SortType.New],
+ sort: SortType.New,
saved_only: false,
};
WebSocketService.Instance.getUserDetails(form);
<UserListing
user={{
name: this.state.recipient.name,
+ preferred_username: this.state.recipient
+ .preferred_username,
avatar: this.state.recipient.avatar,
id: this.state.recipient.id,
local: this.state.recipient.local,
this.state.loading = false;
this.setState(this.state);
return;
- } else if (res.op == UserOperation.EditPrivateMessage) {
+ } else if (
+ res.op == UserOperation.EditPrivateMessage ||
+ res.op == UserOperation.DeletePrivateMessage ||
+ res.op == UserOperation.MarkPrivateMessageAsRead
+ ) {
let data = res.data as PrivateMessageResponse;
this.state.loading = false;
this.props.onEdit(data.message);