Skip to content

Commit

Permalink
lint: comply with rules and improve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
alexruzenhack committed Feb 2, 2024
1 parent 9dd5e7c commit d853251
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sagas/pushNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
take,
takeLatest,
debounce,
delay,
spawn,
} from 'redux-saga/effects';
import messaging from '@react-native-firebase/messaging';
Expand Down Expand Up @@ -320,16 +319,17 @@ 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.
error: take(types.WALLET_STATE_ERROR),
});

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());
Expand Down

0 comments on commit d853251

Please sign in to comment.