()
| 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; |
nothing calls this directly
no outgoing calls
no test coverage detected