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

Method componentDidUpdate

app/components/comments/CommentForm.tsx:69–88  ·  view source on GitHub ↗
(prevProps: Props)

Source from the content-addressed store, hash-verified

67 }
68
69 public componentDidUpdate(prevProps: Props) {
70 const { discussion, comment, teamId } = this.props;
71
72 if (
73 discussion &&
74 prevProps.discussion &&
75 prevProps.discussion.discussionId !== discussion.discussionId
76 ) {
77 this.storageKey = `content-${teamId}-${
78 discussion ? discussion.discussionId : 'new-discussion'
79 }-${comment ? comment.commentId : 'new-comment'}`;
80
81 const draftContent =
82 (typeof localStorage !== 'undefined' && localStorage.getItem(this.storageKey)) || '';
83
84 if (draftContent) {
85 this.setState({ content: draftContent });
86 }
87 }
88 }
89
90 public render() {
91 const { members, store, readOnly, comment, teamId, discussion, isMobile } = this.props;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected