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

Method componentDidUpdate

app/components/messages/MessageForm.tsx:74–89  ·  view source on GitHub ↗
(prevProps: Props)

Source from the content-addressed store, hash-verified

72 }
73
74 public componentDidUpdate(prevProps: Props) {
75 const { chat, message, teamId } = this.props;
76
77 if (chat && prevProps.chat && prevProps.chat.chatId !== chat.chatId) {
78 this.storageKey = `content-${teamId}-${chat ? chat.chatId : 'new-chat'}-${
79 message ? message.messageId : 'new-message'
80 }`;
81
82 const draftContent =
83 (typeof localStorage !== 'undefined' && localStorage.getItem(this.storageKey)) || null;
84
85 if (draftContent) {
86 this.setState({ content: draftContent });
87 }
88 }
89 }
90
91 public render() {
92 const {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected