()
| 51 | |
| 52 | // getting content for non-first comment from local storage |
| 53 | public componentDidMount() { |
| 54 | const { discussion, comment, teamId } = this.props; |
| 55 | |
| 56 | // no need to include userId since it's user's browser |
| 57 | this.storageKey = `content-${teamId}-${ |
| 58 | discussion ? discussion.discussionId : 'new-discussion' |
| 59 | }-${comment ? comment.commentId : 'new-comment'}`; |
| 60 | |
| 61 | const draftContent = |
| 62 | (typeof localStorage !== 'undefined' && localStorage.getItem(this.storageKey)) || ''; |
| 63 | |
| 64 | if (draftContent) { |
| 65 | this.setState({ content: draftContent }); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | public componentDidUpdate(prevProps: Props) { |
| 70 | const { discussion, comment, teamId } = this.props; |
nothing calls this directly
no outgoing calls
no test coverage detected