()
| 260 | }; |
| 261 | |
| 262 | onForeground() { |
| 263 | if (this.props.loggedIn) { |
| 264 | void this.ensurePushNotifsEnabled(); |
| 265 | } else { |
| 266 | // We do this in case there was a crash, so we can clear deviceToken from |
| 267 | // any other cookies it might be set for |
| 268 | const deviceTokensMap: { [string]: string } = {}; |
| 269 | for (const keyserverID in this.props.deviceTokens) { |
| 270 | const deviceToken = this.props.deviceTokens[keyserverID]; |
| 271 | if (deviceToken) { |
| 272 | deviceTokensMap[keyserverID] = deviceToken; |
| 273 | } |
| 274 | } |
| 275 | this.setDeviceToken(deviceTokensMap, { type: 'nothing_to_set' }); |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | componentDidUpdate(prevProps: Props, prevState: State) { |
| 280 | if (this.props.activeThread !== prevProps.activeThread) { |
no test coverage detected