(prevProps: Props, prevState: State)
| 277 | } |
| 278 | |
| 279 | componentDidUpdate(prevProps: Props, prevState: State) { |
| 280 | if (this.props.activeThread !== prevProps.activeThread) { |
| 281 | this.clearNotifsOfThread(); |
| 282 | } |
| 283 | void this.updateBadgeCount(); |
| 284 | |
| 285 | for (const threadID of this.openThreadOnceReceived) { |
| 286 | const threadInfo = this.props.threadInfos[threadID]; |
| 287 | if (threadInfo) { |
| 288 | this.navigateToThread(threadInfo, false); |
| 289 | this.openThreadOnceReceived.clear(); |
| 290 | break; |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | if (this.props.loggedIn && !prevProps.loggedIn) { |
| 295 | void this.ensurePushNotifsEnabled(); |
| 296 | } else if (!this.props.localToken && prevProps.localToken) { |
| 297 | void this.ensurePushNotifsEnabled(); |
| 298 | } else { |
| 299 | for (const keyserverID in this.props.deviceTokens) { |
| 300 | const deviceToken = this.props.deviceTokens[keyserverID]; |
| 301 | const prevDeviceToken = prevProps.deviceTokens[keyserverID]; |
| 302 | if (!deviceToken && prevDeviceToken) { |
| 303 | void this.ensurePushNotifsEnabled(); |
| 304 | break; |
| 305 | } |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | if (!this.props.loggedIn && prevProps.loggedIn) { |
| 310 | this.clearAllNotifs(); |
| 311 | void this.resetBadgeCount(); |
| 312 | } |
| 313 | |
| 314 | if ( |
| 315 | this.state.inAppNotifProps && |
| 316 | this.state.inAppNotifProps !== prevState.inAppNotifProps |
| 317 | ) { |
| 318 | Haptics.notificationAsync(); |
| 319 | InAppNotification.show(); |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | async updateBadgeCount() { |
| 324 | const curThinUnreadCounts = this.props.thinThreadsUnreadCount; |
nothing calls this directly
no test coverage detected