MCPcopy Create free account
hub / github.com/CommE2E/comm / onForeground

Method onForeground

native/push/push-handler.react.js:262–277  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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) {

Callers 2

componentDidMountMethod · 0.95
PushHandlerClass · 0.95

Calls 2

setDeviceTokenMethod · 0.95

Tested by

no test coverage detected