From 4197662c37a1fbf7c61d74550713e1e4c4d73bfa Mon Sep 17 00:00:00 2001 From: Alex Ruzenhack Date: Fri, 2 Feb 2024 01:29:36 +0000 Subject: [PATCH] lint: comply with rules and improve comment --- src/components/AskForPushNotification.js | 16 +++++++++------- src/sagas/pushNotification.js | 8 ++++---- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/components/AskForPushNotification.js b/src/components/AskForPushNotification.js index 2ca82057a..f1a468d89 100644 --- a/src/components/AskForPushNotification.js +++ b/src/components/AskForPushNotification.js @@ -17,13 +17,15 @@ export default function AskForPushNotification(props) { dispatch(pushDismissOptInQuestion()); }; - const pushNotificationOptInModal = () => (); + const pushNotificationOptInModal = () => ( + + ); if (showOptIn) { return pushNotificationOptInModal(); diff --git a/src/sagas/pushNotification.js b/src/sagas/pushNotification.js index 56d93f37c..174273898 100644 --- a/src/sagas/pushNotification.js +++ b/src/sagas/pushNotification.js @@ -15,7 +15,6 @@ import { take, takeLatest, debounce, - delay, spawn, } from 'redux-saga/effects'; import messaging from '@react-native-firebase/messaging'; @@ -320,7 +319,7 @@ export function* init() { // after its initialization, but only opens the opt-in // modal after waller become ready. // Spwan creates a detached thread from this current thread. - yield spawn(function* handleOptIn(){ + yield spawn(function* handleOptIn() { const { ready } = yield race({ ready: take(types.WALLET_STATE_READY), // Do nothing with error, only terminates the thread. @@ -328,8 +327,9 @@ export function* init() { }); if (ready) { - // If the user has not been asked yet, we should ask him if he wants to enable push notifications - // We should appear only once, so we should save the fact that the user has dismissed the question + // Ask user for push notification opt-in if it has not + // been asked previously. It appears only once because + // we persist the dismiss action on store. const optInDismissed = STORE.getItem(pushNotificationKey.optInDismissed); if (optInDismissed === null || !optInDismissed) { yield put(pushAskOptInQuestion());