Skip to content

Commit

Permalink
fix(tracking): don't try to close UI on a not triggered context if no…
Browse files Browse the repository at this point in the history
…t opened
  • Loading branch information
lutangar committed Nov 22, 2019
1 parent 30a9a5e commit 2d1ed1b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app/content/sagas/notices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CLOSED } from 'app/constants/ActionTypes';
import { StatefulNotice } from 'app/lmem/notice';
import { CloseCause } from 'app/lmem/ui';
import { AppAction, createErrorAction } from 'app/actions';
import { getNotices, hasNoticesToDisplay } from '../selectors';
import { getNotices, hasNoticesToDisplay, isOpen } from '../selectors';

export function* closeIfNoMoreNoticeToDisplaySaga() {
try {
Expand Down Expand Up @@ -47,7 +47,10 @@ export const isChangeOnNoticeAction = (action: AppAction) =>
action.type === 'MARK_NOTICE_READ' || action.type === 'FEEDBACK_ON_NOTICE';

function* closeUISaga() {
yield put(close(CloseCause.NoMoreNotice));
const open = yield select(isOpen);
if (open) {
yield put(close(CloseCause.NoMoreNotice));
}
}

export default function* noticesRootSaga() {
Expand Down

0 comments on commit 2d1ed1b

Please sign in to comment.