Move Video challenges under challenges dir
Remove old hikes components Remove unused jobs stuff
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import errSaga from './err-saga';
|
||||
import titleSaga from './title-saga';
|
||||
import localStorageSaga from './local-storage-saga';
|
||||
import hardGoToSaga from './hard-go-to-saga';
|
||||
import windowSaga from './window-saga';
|
||||
import executeChallengeSaga from './execute-challenge-saga';
|
||||
@@ -11,7 +10,6 @@ import gitterSaga from './gitter-saga';
|
||||
export default [
|
||||
errSaga,
|
||||
titleSaga,
|
||||
localStorageSaga,
|
||||
hardGoToSaga,
|
||||
windowSaga,
|
||||
executeChallengeSaga,
|
||||
|
@@ -1,43 +0,0 @@
|
||||
import store from 'store';
|
||||
import {
|
||||
saveForm,
|
||||
clearForm,
|
||||
loadSavedForm
|
||||
} from '../../common/app/routes/Jobs/redux/types';
|
||||
|
||||
import {
|
||||
saveCompleted,
|
||||
loadSavedFormCompleted
|
||||
} from '../../common/app/routes/Jobs/redux/actions';
|
||||
|
||||
const formKey = 'newJob';
|
||||
|
||||
export default function localStorageSaga(action$) {
|
||||
return action$
|
||||
.filter(action => {
|
||||
return action.type === saveForm ||
|
||||
action.type === clearForm ||
|
||||
action.type === loadSavedForm;
|
||||
})
|
||||
.map(action => {
|
||||
if (action.type === saveForm) {
|
||||
const form = action.payload;
|
||||
try {
|
||||
store.setItem(formKey, form);
|
||||
return saveCompleted(form);
|
||||
} catch (error) {
|
||||
return {
|
||||
type: 'app.handleError',
|
||||
error
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (action.type === clearForm) {
|
||||
store.removeItem(formKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
return loadSavedFormCompleted(store.getItem(formKey));
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user