MCPcopy Create free account
hub / github.com/async-labs/async / componentDidMount

Method componentDidMount

app/components/messages/MessageForm.tsx:58–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56
57 // getting content for non-first message from local storage
58 public componentDidMount() {
59 const { chat, message, teamId } = this.props;
60
61 // no need to include userId since it's user's browser
62 this.storageKey = `content-${teamId}-${chat ? chat.chatId : 'new-chat'}-${
63 message ? message.messageId : 'new-message'
64 }`;
65
66 const draftContent =
67 (typeof localStorage !== 'undefined' && localStorage.getItem(this.storageKey)) || null;
68
69 if (draftContent) {
70 this.setState({ content: draftContent });
71 }
72 }
73
74 public componentDidUpdate(prevProps: Props) {
75 const { chat, message, teamId } = this.props;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected