Repository URL to install this package:
|
Version:
0.4.8 ▾
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _regenerator = require('babel-runtime/regenerator');
var _regenerator2 = _interopRequireDefault(_regenerator);
exports.default = settingsSaga;
var _effects = require('redux-saga/effects');
var _settings = require('../actions/settings');
var _actions = require('../actions');
var _settingsApi = require('./settingsApi');
var _settingsApi2 = _interopRequireDefault(_settingsApi);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _marked = /*#__PURE__*/_regenerator2.default.mark(onNewPasswordSave),
_marked2 = /*#__PURE__*/_regenerator2.default.mark(onNewEmailSave),
_marked3 = /*#__PURE__*/_regenerator2.default.mark(onUserSave),
_marked4 = /*#__PURE__*/_regenerator2.default.mark(onAccountDelete),
_marked5 = /*#__PURE__*/_regenerator2.default.mark(onThirdPartyDelete),
_marked6 = /*#__PURE__*/_regenerator2.default.mark(onFetchPremiums),
_marked7 = /*#__PURE__*/_regenerator2.default.mark(onLogout),
_marked8 = /*#__PURE__*/_regenerator2.default.mark(onDeleteCalendar),
_marked9 = /*#__PURE__*/_regenerator2.default.mark(onGetDoodleFeed),
_marked10 = /*#__PURE__*/_regenerator2.default.mark(onConnectDoodleFeed),
_marked11 = /*#__PURE__*/_regenerator2.default.mark(onResetDoodleFeed),
_marked12 = /*#__PURE__*/_regenerator2.default.mark(onDeleteAddressBook),
_marked13 = /*#__PURE__*/_regenerator2.default.mark(onLogoutApps),
_marked14 = /*#__PURE__*/_regenerator2.default.mark(onGetApps),
_marked15 = /*#__PURE__*/_regenerator2.default.mark(onSaveAvatar),
_marked16 = /*#__PURE__*/_regenerator2.default.mark(onDeleteAvatar),
_marked17 = /*#__PURE__*/_regenerator2.default.mark(watchSaveNewPassword),
_marked18 = /*#__PURE__*/_regenerator2.default.mark(watchSaveEmail),
_marked19 = /*#__PURE__*/_regenerator2.default.mark(watchSaveUser),
_marked20 = /*#__PURE__*/_regenerator2.default.mark(watchDeleteAccount),
_marked21 = /*#__PURE__*/_regenerator2.default.mark(watchDeleteThirdParty),
_marked22 = /*#__PURE__*/_regenerator2.default.mark(watchFetchPremiums),
_marked23 = /*#__PURE__*/_regenerator2.default.mark(watchLogout),
_marked24 = /*#__PURE__*/_regenerator2.default.mark(watchDeleteCalendar),
_marked25 = /*#__PURE__*/_regenerator2.default.mark(watchGetDoodleFeed),
_marked26 = /*#__PURE__*/_regenerator2.default.mark(watchConnectDoodleFeed),
_marked27 = /*#__PURE__*/_regenerator2.default.mark(watchResetDoodleFeed),
_marked28 = /*#__PURE__*/_regenerator2.default.mark(watchDeleteAddressBook),
_marked29 = /*#__PURE__*/_regenerator2.default.mark(watchLogoutApps),
_marked30 = /*#__PURE__*/_regenerator2.default.mark(watchGetApps),
_marked31 = /*#__PURE__*/_regenerator2.default.mark(watchSaveAvatar),
_marked32 = /*#__PURE__*/_regenerator2.default.mark(watchDeleteAvatar),
_marked33 = /*#__PURE__*/_regenerator2.default.mark(settingsSaga);
function onNewPasswordSave(options, action) {
var _action$payload, newPassword, currentPassword, token;
return _regenerator2.default.wrap(function onNewPasswordSave$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.prev = 0;
_action$payload = action.payload, newPassword = _action$payload.newPassword, currentPassword = _action$payload.currentPassword;
_context.next = 4;
return (0, _effects.select)(function (state) {
return state.user.data.accessToken;
});
case 4:
token = _context.sent;
_context.next = 7;
return (0, _effects.call)(_settingsApi2.default.saveUser, token, { newPassword: newPassword, password: currentPassword }, options);
case 7:
_context.next = 9;
return (0, _effects.put)((0, _settings.saveNewPasswordSuccess)());
case 9:
_context.next = 15;
break;
case 11:
_context.prev = 11;
_context.t0 = _context['catch'](0);
_context.next = 15;
return (0, _effects.put)((0, _settings.saveNewPasswordError)(_context.t0));
case 15:
case 'end':
return _context.stop();
}
}
}, _marked, this, [[0, 11]]);
}
function onNewEmailSave(options, action) {
var token, newEmail;
return _regenerator2.default.wrap(function onNewEmailSave$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.prev = 0;
_context2.next = 3;
return (0, _effects.select)(function (state) {
return state.user.data.accessToken;
});
case 3:
token = _context2.sent;
newEmail = action.newEmail;
_context2.next = 7;
return (0, _effects.call)(_settingsApi2.default.saveUser, token, { newEmail: newEmail }, options);
case 7:
_context2.next = 9;
return (0, _effects.put)((0, _settings.saveNewEmailSuccess)());
case 9:
_context2.next = 15;
break;
case 11:
_context2.prev = 11;
_context2.t0 = _context2['catch'](0);
_context2.next = 15;
return (0, _effects.put)((0, _settings.saveNewEmailError)(_context2.t0));
case 15:
case 'end':
return _context2.stop();
}
}
}, _marked2, this, [[0, 11]]);
}
function onUserSave(options, action) {
var token;
return _regenerator2.default.wrap(function onUserSave$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
_context3.prev = 0;
_context3.next = 3;
return (0, _effects.select)(function (state) {
return state.user.data.accessToken;
});
case 3:
token = _context3.sent;
_context3.next = 6;
return (0, _effects.call)(_settingsApi2.default.saveUser, token, action.data, options);
case 6:
_context3.next = 8;
return (0, _effects.put)((0, _settings.saveUserSuccess)());
case 8:
_context3.next = 14;
break;
case 10:
_context3.prev = 10;
_context3.t0 = _context3['catch'](0);
_context3.next = 14;
return (0, _effects.put)((0, _settings.saveUserError)(_context3.t0));
case 14:
case 'end':
return _context3.stop();
}
}
}, _marked3, this, [[0, 10]]);
}
function onAccountDelete(options, action) {
var password, token;
return _regenerator2.default.wrap(function onAccountDelete$(_context4) {
while (1) {
switch (_context4.prev = _context4.next) {
case 0:
_context4.prev = 0;
password = action.password;
_context4.next = 4;
return (0, _effects.select)(function (state) {
return state.user.data.accessToken;
});
case 4:
token = _context4.sent;
_context4.next = 7;
return (0, _effects.call)(_settingsApi2.default.deleteAccount, token, { password: password }, options);
case 7:
_context4.next = 9;
return (0, _effects.put)((0, _settings.deleteAccountSuccess)());
case 9:
_context4.next = 15;
break;
case 11:
_context4.prev = 11;
_context4.t0 = _context4['catch'](0);
_context4.next = 15;
return (0, _effects.put)((0, _settings.deleteAccountError)(_context4.t0));
case 15:
case 'end':
return _context4.stop();
}
}
}, _marked4, this, [[0, 11]]);
}
function onThirdPartyDelete(options, action) {
var id, token;
return _regenerator2.default.wrap(function onThirdPartyDelete$(_context5) {
while (1) {
switch (_context5.prev = _context5.next) {
case 0:
_context5.prev = 0;
id = action.id;
_context5.next = 4;
return (0, _effects.select)(function (state) {
return state.user.data.accessToken;
});
case 4:
token = _context5.sent;
_context5.next = 7;
return (0, _effects.call)(_settingsApi2.default.deleteThirdParty, token, id, options);
case 7:
_context5.next = 9;
return (0, _effects.put)((0, _settings.deleteThirdPartySuccess)());
case 9:
_context5.next = 11;
return (0, _effects.put)((0, _actions.loadUser)());
case 11:
_context5.next = 17;
break;
case 13:
_context5.prev = 13;
_context5.t0 = _context5['catch'](0);
_context5.next = 17;
return (0, _effects.put)((0, _settings.deleteThirdPartyError)(_context5.t0));
case 17:
case 'end':
return _context5.stop();
}
}
}, _marked5, this, [[0, 13]]);
}
function onFetchPremiums(options) {
var token, premiums;
return _regenerator2.default.wrap(function onFetchPremiums$(_context6) {
while (1) {
switch (_context6.prev = _context6.next) {
case 0:
_context6.prev = 0;
_context6.next = 3;
return (0, _effects.select)(function (state) {
return state.user.data.accessToken;
});
case 3:
token = _context6.sent;
_context6.next = 6;
return (0, _effects.call)(_settingsApi2.default.fetchPremiums, token, options);
case 6:
premiums = _context6.sent;
_context6.next = 9;
return (0, _effects.put)((0, _settings.fetchPremiumsSuccess)(premiums));
case 9:
_context6.next = 15;
break;
case 11:
_context6.prev = 11;
_context6.t0 = _context6['catch'](0);
_context6.next = 15;
return (0, _effects.put)((0, _settings.fetchPremiumsError)(_context6.t0));
case 15:
case 'end':
return _context6.stop();
}
}
}, _marked6, this, [[0, 11]]);
}
function onLogout(options) {
return _regenerator2.default.wrap(function onLogout$(_context7) {
while (1) {
switch (_context7.prev = _context7.next) {
case 0:
_context7.next = 2;
return (0, _effects.put)((0, _settings.resetNags)());
case 2:
case 'end':
return _context7.stop();
}
}
}, _marked7, this);
}
function onDeleteCalendar(options, action) {
var id, token;
return _regenerator2.default.wrap(function onDeleteCalendar$(_context8) {
while (1) {
switch (_context8.prev = _context8.next) {
case 0:
_context8.prev = 0;
id = action.id;
_context8.next = 4;
return (0, _effects.select)(function (state) {
return state.user.data.accessToken;
});
case 4:
token = _context8.sent;
_context8.next = 7;
return (0, _effects.call)(_settingsApi2.default.deleteCalendar, token, id, options);
case 7:
_context8.next = 9;
return (0, _effects.put)((0, _settings.deleteCalendarSuccess)());
case 9:
_context8.next = 11;
return (0, _effects.put)((0, _actions.loadUser)());
case 11:
_context8.next = 17;
break;
case 13:
_context8.prev = 13;
_context8.t0 = _context8['catch'](0);
_context8.next = 17;
return (0, _effects.put)((0, _settings.deleteCalendarError)(_context8.t0));
case 17:
case 'end':
return _context8.stop();
}
}
}, _marked8, this, [[0, 13]]);
}
function onGetDoodleFeed(options) {
var token, feed;
return _regenerator2.default.wrap(function onGetDoodleFeed$(_context9) {
while (1) {
switch (_context9.prev = _context9.next) {
case 0:
_context9.prev = 0;
_context9.next = 3;
return (0, _effects.select)(function (state) {
return state.user.data.accessToken;
});
case 3:
token = _context9.sent;
_context9.next = 6;
return (0, _effects.call)(_settingsApi2.default.getDoodleFeed, token, options);
case 6:
feed = _context9.sent;
_context9.next = 9;
return (0, _effects.put)((0, _settings.getDoodleFeedSuccess)(feed.url));
case 9:
_context9.next = 15;
break;
case 11:
_context9.prev = 11;
_context9.t0 = _context9['catch'](0);
_context9.next = 15;
return (0, _effects.put)((0, _settings.getDoodleFeedError)(_context9.t0));
case 15:
case 'end':
return _context9.stop();
}
}
}, _marked9, this, [[0, 11]]);
}
function onConnectDoodleFeed(options, action) {
var url, token;
return _regenerator2.default.wrap(function onConnectDoodleFeed$(_context10) {
while (1) {
switch (_context10.prev = _context10.next) {
case 0:
_context10.prev = 0;
url = action.url;
_context10.next = 4;
return (0, _effects.select)(function (state) {
return state.user.data.accessToken;
});
case 4:
token = _context10.sent;
_context10.next = 7;
return (0, _effects.call)(_settingsApi2.default.connectDoodleFeed, token, { url: url }, options);
case 7:
_context10.next = 9;
return (0, _effects.put)((0, _settings.connectDoodleFeedSuccess)());
case 9:
_context10.next = 11;
return (0, _effects.put)((0, _actions.loadUser)());
case 11:
_context10.next = 17;
break;
case 13:
_context10.prev = 13;
_context10.t0 = _context10['catch'](0);
_context10.next = 17;
return (0, _effects.put)((0, _settings.connectDoodleFeedError)(_context10.t0));
case 17:
case 'end':
return _context10.stop();
}
}
}, _marked10, this, [[0, 13]]);
}
function onResetDoodleFeed(options) {
var token, feed;
return _regenerator2.default.wrap(function onResetDoodleFeed$(_context11) {
while (1) {
switch (_context11.prev = _context11.next) {
case 0:
_context11.prev = 0;
_context11.next = 3;
return (0, _effects.select)(function (state) {
return state.user.data.accessToken;
});
case 3:
token = _context11.sent;
_context11.next = 6;
return (0, _effects.call)(_settingsApi2.default.resetDoodleFeed, token, options);
case 6:
feed = _context11.sent;
_context11.next = 9;
return (0, _effects.put)((0, _settings.resetDoodleFeedSuccess)(feed.url));
case 9:
_context11.next = 15;
break;
case 11:
_context11.prev = 11;
_context11.t0 = _context11['catch'](0);
_context11.next = 15;
return (0, _effects.put)((0, _settings.resetDoodleFeedError)(_context11.t0));
case 15:
case 'end':
return _context11.stop();
}
}
}, _marked11, this, [[0, 11]]);
}
function onDeleteAddressBook(options, action) {
var id, token;
return _regenerator2.default.wrap(function onDeleteAddressBook$(_context12) {
while (1) {
switch (_context12.prev = _context12.next) {
case 0:
_context12.prev = 0;
id = action.id;
_context12.next = 4;
return (0, _effects.select)(function (state) {
return state.user.data.accessToken;
});
case 4:
token = _context12.sent;
_context12.next = 7;
return (0, _effects.call)(_settingsApi2.default.deleteAddressBook, token, id, options);
case 7:
_context12.next = 9;
return (0, _effects.put)((0, _settings.deleteAddressBookSuccess)());
case 9:
_context12.next = 11;
return (0, _effects.put)((0, _actions.loadUser)());
case 11:
_context12.next = 17;
break;
case 13:
_context12.prev = 13;
_context12.t0 = _context12['catch'](0);
_context12.next = 17;
return (0, _effects.put)((0, _settings.deleteAddressBookError)(_context12.t0));
case 17:
case 'end':
return _context12.stop();
}
}
}, _marked12, this, [[0, 13]]);
}
function onLogoutApps(options) {
var token;
return _regenerator2.default.wrap(function onLogoutApps$(_context13) {
while (1) {
switch (_context13.prev = _context13.next) {
case 0:
_context13.prev = 0;
_context13.next = 3;
return (0, _effects.select)(function (state) {
return state.user.data.accessToken;
});
case 3:
token = _context13.sent;
_context13.next = 6;
return (0, _effects.call)(_settingsApi2.default.logoutApps, token, options);
case 6:
_context13.next = 8;
return (0, _effects.put)((0, _settings.logoutAppsSuccess)());
case 8:
_context13.next = 10;
return (0, _effects.put)((0, _actions.logout)());
case 10:
_context13.next = 16;
break;
case 12:
_context13.prev = 12;
_context13.t0 = _context13['catch'](0);
_context13.next = 16;
return (0, _effects.put)((0, _settings.logoutAppsError)(_context13.t0));
case 16:
case 'end':
return _context13.stop();
}
}
}, _marked13, this, [[0, 12]]);
}
function onGetApps(options) {
var token, apps;
return _regenerator2.default.wrap(function onGetApps$(_context14) {
while (1) {
switch (_context14.prev = _context14.next) {
case 0:
_context14.prev = 0;
_context14.next = 3;
return (0, _effects.select)(function (state) {
return state.user.data.accessToken;
});
case 3:
token = _context14.sent;
_context14.next = 6;
return (0, _effects.call)(_settingsApi2.default.getApps, token, options);
case 6:
apps = _context14.sent;
_context14.next = 9;
return (0, _effects.put)((0, _settings.getAppsSuccess)(apps));
case 9:
_context14.next = 15;
break;
case 11:
_context14.prev = 11;
_context14.t0 = _context14['catch'](0);
_context14.next = 15;
return (0, _effects.put)((0, _settings.getAppsError)(_context14.t0));
case 15:
case 'end':
return _context14.stop();
}
}
}, _marked14, this, [[0, 11]]);
}
function onSaveAvatar(options, action) {
var _action$payload2, file, fileType, token;
return _regenerator2.default.wrap(function onSaveAvatar$(_context15) {
while (1) {
switch (_context15.prev = _context15.next) {
case 0:
_context15.prev = 0;
_action$payload2 = action.payload, file = _action$payload2.file, fileType = _action$payload2.fileType;
_context15.next = 4;
return (0, _effects.select)(function (state) {
return state.user.data.accessToken;
});
case 4:
token = _context15.sent;
_context15.next = 7;
return (0, _effects.call)(_settingsApi2.default.saveAvatar, token, file, fileType, options);
case 7:
_context15.next = 9;
return (0, _effects.put)((0, _settings.saveAvatarSuccess)());
case 9:
_context15.next = 15;
break;
case 11:
_context15.prev = 11;
_context15.t0 = _context15['catch'](0);
_context15.next = 15;
return (0, _effects.put)((0, _settings.saveAvatarError)(_context15.t0));
case 15:
case 'end':
return _context15.stop();
}
}
}, _marked15, this, [[0, 11]]);
}
function onDeleteAvatar(options) {
var token;
return _regenerator2.default.wrap(function onDeleteAvatar$(_context16) {
while (1) {
switch (_context16.prev = _context16.next) {
case 0:
_context16.prev = 0;
_context16.next = 3;
return (0, _effects.select)(function (state) {
return state.user.data.accessToken;
});
case 3:
token = _context16.sent;
_context16.next = 6;
return (0, _effects.call)(_settingsApi2.default.deleteAvatar, token, options);
case 6:
_context16.next = 8;
return (0, _effects.put)((0, _settings.deleteAvatarSuccess)());
case 8:
_context16.next = 14;
break;
case 10:
_context16.prev = 10;
_context16.t0 = _context16['catch'](0);
_context16.next = 14;
return (0, _effects.put)((0, _settings.deleteAvatarError)(_context16.t0));
case 14:
case 'end':
return _context16.stop();
}
}
}, _marked16, this, [[0, 10]]);
}
function watchSaveNewPassword(options) {
return _regenerator2.default.wrap(function watchSaveNewPassword$(_context17) {
while (1) {
switch (_context17.prev = _context17.next) {
case 0:
_context17.next = 2;
return (0, _effects.takeLatest)(_settings.SettingsActionTypes.SAVE_NEW_PASSWORD, onNewPasswordSave, options);
case 2:
case 'end':
return _context17.stop();
}
}
}, _marked17, this);
}
function watchSaveEmail(options) {
return _regenerator2.default.wrap(function watchSaveEmail$(_context18) {
while (1) {
switch (_context18.prev = _context18.next) {
case 0:
_context18.next = 2;
return (0, _effects.takeLatest)(_settings.SettingsActionTypes.SAVE_NEW_EMAIL, onNewEmailSave, options);
case 2:
case 'end':
return _context18.stop();
}
}
}, _marked18, this);
}
function watchSaveUser(options) {
return _regenerator2.default.wrap(function watchSaveUser$(_context19) {
while (1) {
switch (_context19.prev = _context19.next) {
case 0:
_context19.next = 2;
return (0, _effects.takeLatest)(_settings.SettingsActionTypes.SAVE_USER, onUserSave, options);
case 2:
case 'end':
return _context19.stop();
}
}
}, _marked19, this);
}
function watchDeleteAccount(options) {
return _regenerator2.default.wrap(function watchDeleteAccount$(_context20) {
while (1) {
switch (_context20.prev = _context20.next) {
case 0:
_context20.next = 2;
return (0, _effects.takeLatest)(_settings.SettingsActionTypes.DELETE_ACCOUNT, onAccountDelete, options);
case 2:
case 'end':
return _context20.stop();
}
}
}, _marked20, this);
}
function watchDeleteThirdParty(options) {
return _regenerator2.default.wrap(function watchDeleteThirdParty$(_context21) {
while (1) {
switch (_context21.prev = _context21.next) {
case 0:
_context21.next = 2;
return (0, _effects.takeLatest)(_settings.SettingsActionTypes.DELETE_THIRD_PARTY, onThirdPartyDelete, options);
case 2:
case 'end':
return _context21.stop();
}
}
}, _marked21, this);
}
function watchFetchPremiums(options) {
return _regenerator2.default.wrap(function watchFetchPremiums$(_context22) {
while (1) {
switch (_context22.prev = _context22.next) {
case 0:
_context22.next = 2;
return (0, _effects.takeLatest)(_settings.SettingsActionTypes.FETCH_PREMIUMS, onFetchPremiums, options);
case 2:
case 'end':
return _context22.stop();
}
}
}, _marked22, this);
}
function watchLogout(options) {
return _regenerator2.default.wrap(function watchLogout$(_context23) {
while (1) {
switch (_context23.prev = _context23.next) {
case 0:
_context23.next = 2;
return (0, _effects.takeLatest)(_actions.ActionTypes.LOGOUT, onLogout, options);
case 2:
case 'end':
return _context23.stop();
}
}
}, _marked23, this);
}
function watchDeleteCalendar(options) {
return _regenerator2.default.wrap(function watchDeleteCalendar$(_context24) {
while (1) {
switch (_context24.prev = _context24.next) {
case 0:
_context24.next = 2;
return (0, _effects.takeLatest)(_settings.SettingsActionTypes.DELETE_CALENDAR, onDeleteCalendar, options);
case 2:
case 'end':
return _context24.stop();
}
}
}, _marked24, this);
}
function watchGetDoodleFeed(options) {
return _regenerator2.default.wrap(function watchGetDoodleFeed$(_context25) {
while (1) {
switch (_context25.prev = _context25.next) {
case 0:
_context25.next = 2;
return (0, _effects.takeLatest)(_settings.SettingsActionTypes.GET_DOODLE_FEED, onGetDoodleFeed, options);
case 2:
case 'end':
return _context25.stop();
}
}
}, _marked25, this);
}
function watchConnectDoodleFeed(options) {
return _regenerator2.default.wrap(function watchConnectDoodleFeed$(_context26) {
while (1) {
switch (_context26.prev = _context26.next) {
case 0:
_context26.next = 2;
return (0, _effects.takeLatest)(_settings.SettingsActionTypes.CONNECT_DOODLE_FEED, onConnectDoodleFeed, options);
case 2:
case 'end':
return _context26.stop();
}
}
}, _marked26, this);
}
function watchResetDoodleFeed(options) {
return _regenerator2.default.wrap(function watchResetDoodleFeed$(_context27) {
while (1) {
switch (_context27.prev = _context27.next) {
case 0:
_context27.next = 2;
return (0, _effects.takeLatest)(_settings.SettingsActionTypes.RESET_DOODLE_FEED, onResetDoodleFeed, options);
case 2:
case 'end':
return _context27.stop();
}
}
}, _marked27, this);
}
function watchDeleteAddressBook(options) {
return _regenerator2.default.wrap(function watchDeleteAddressBook$(_context28) {
while (1) {
switch (_context28.prev = _context28.next) {
case 0:
_context28.next = 2;
return (0, _effects.takeLatest)(_settings.SettingsActionTypes.DELETE_ADDRESS_BOOK, onDeleteAddressBook, options);
case 2:
case 'end':
return _context28.stop();
}
}
}, _marked28, this);
}
function watchLogoutApps(options) {
return _regenerator2.default.wrap(function watchLogoutApps$(_context29) {
while (1) {
switch (_context29.prev = _context29.next) {
case 0:
_context29.next = 2;
return (0, _effects.takeLatest)(_settings.SettingsActionTypes.LOGOUT_APPS, onLogoutApps, options);
case 2:
case 'end':
return _context29.stop();
}
}
}, _marked29, this);
}
function watchGetApps(options) {
return _regenerator2.default.wrap(function watchGetApps$(_context30) {
while (1) {
switch (_context30.prev = _context30.next) {
case 0:
_context30.next = 2;
return (0, _effects.takeLatest)(_settings.SettingsActionTypes.GET_APPS, onGetApps, options);
case 2:
case 'end':
return _context30.stop();
}
}
}, _marked30, this);
}
function watchSaveAvatar(options) {
return _regenerator2.default.wrap(function watchSaveAvatar$(_context31) {
while (1) {
switch (_context31.prev = _context31.next) {
case 0:
_context31.next = 2;
return (0, _effects.takeLatest)(_settings.SettingsActionTypes.SAVE_AVATAR, onSaveAvatar, options);
case 2:
case 'end':
return _context31.stop();
}
}
}, _marked31, this);
}
function watchDeleteAvatar(options) {
return _regenerator2.default.wrap(function watchDeleteAvatar$(_context32) {
while (1) {
switch (_context32.prev = _context32.next) {
case 0:
_context32.next = 2;
return (0, _effects.takeLatest)(_settings.SettingsActionTypes.DELETE_AVATAR, onDeleteAvatar, options);
case 2:
case 'end':
return _context32.stop();
}
}
}, _marked32, this);
}
function settingsSaga() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return _regenerator2.default.wrap(function settingsSaga$(_context33) {
while (1) {
switch (_context33.prev = _context33.next) {
case 0:
_context33.next = 2;
return (0, _effects.all)([(0, _effects.call)(watchSaveNewPassword, options), (0, _effects.call)(watchSaveUser, options), (0, _effects.call)(watchSaveEmail, options), (0, _effects.call)(watchDeleteAccount, options), (0, _effects.call)(watchDeleteThirdParty, options), (0, _effects.call)(watchFetchPremiums, options), (0, _effects.call)(watchLogout, options), (0, _effects.call)(watchDeleteCalendar, options), (0, _effects.call)(watchGetDoodleFeed, options), (0, _effects.call)(watchConnectDoodleFeed, options), (0, _effects.call)(watchResetDoodleFeed, options), (0, _effects.call)(watchDeleteAddressBook, options), (0, _effects.call)(watchSaveAvatar, options), (0, _effects.call)(watchDeleteAvatar, options), (0, _effects.call)(watchLogoutApps, options), (0, _effects.call)(watchGetApps, options)]);
case 2:
case 'end':
return _context33.stop();
}
}
}, _marked33, this);
}