Skip to content

Commit

Permalink
fix: feature acknowlegement
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lopukhin committed Mar 14, 2018
1 parent ff76777 commit 1721ffb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions app/components/FeatureHighlight/FeatureHighlight.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ const FeatureHighlight = ({
? (
<Tooltip
content={description}
onClick={() => dispatch(uiActions.acknowlegdeFeature({ featureId: 'multiAccounts' }))}
>
<FeatureContainer>
<FeatureContainer
onClick={() => dispatch(uiActions.acknowlegdeFeature({ featureId: 'multiAccounts' }))}
>
{children}
<Lozenge appearance="new">New</Lozenge>
</FeatureContainer>
Expand Down
6 changes: 3 additions & 3 deletions app/sagas/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
takeEvery,
put,
call,
take,
fork,
select,
} from 'redux-saga/effects';
Expand Down Expand Up @@ -223,12 +222,13 @@ export function* watchSetIssuesFilter(): Generator<*, *, *> {
}

export function* newFeaturesFlow(): Generator<*, *, *> {
while (true) {
const { payload: { featureId } } = yield take(actionTypes.ACKNOWLEDGE_FEATURE);
function* flow({ payload: { featureId } }): Generator<*, void, *> {
let acknowlegdedFeatures = yield call(getFromStorage, 'acknowlegdedFeatures');
if (!acknowlegdedFeatures) acknowlegdedFeatures = [];
acknowlegdedFeatures.push(featureId);
yield call(setToStorage, 'acknowlegdedFeatures', acknowlegdedFeatures);
yield call(delay, 10000);
yield put(uiActions.setUiState('acknowlegdedFeatures', acknowlegdedFeatures));
}
yield takeLatest(actionTypes.ACKNOWLEDGE_FEATURE, flow);
}

0 comments on commit 1721ffb

Please sign in to comment.