1 import { put } from 'redux-saga/effects';
4 setBreachedAliasResolved,
5 setBreachedCustomEmailResolved,
6 setBreachedProtonAddressResolved,
7 } from '@proton/pass/lib/monitor/monitor.request';
8 import { AddressType } from '@proton/pass/lib/monitor/types';
9 import { getAliasBreach, getCustomBreach, getProtonBreach, resolveAddressMonitor } from '@proton/pass/store/actions';
10 import { createRequestSaga } from '@proton/pass/store/request/sagas';
12 export default createRequestSaga({
13 actions: resolveAddressMonitor,
14 call: function* (address) {
15 switch (address.type) {
16 case AddressType.ALIAS: {
17 yield setBreachedAliasResolved(address.shareId, address.itemId);
18 yield put(getAliasBreach.intent(address));
22 case AddressType.CUSTOM: {
23 yield setBreachedCustomEmailResolved(address.addressId);
24 yield put(getCustomBreach.intent(address.addressId));
28 case AddressType.PROTON: {
29 yield setBreachedProtonAddressResolved(address.addressId);
30 yield put(getProtonBreach.intent(address.addressId));