mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-28 15:47:48 +01:00
fix some spelling issues
This commit is contained in:
9
.vscode/settings.json
vendored
9
.vscode/settings.json
vendored
@@ -4,5 +4,12 @@
|
|||||||
"**/package-lock.json": true
|
"**/package-lock.json": true
|
||||||
},
|
},
|
||||||
"editor.insertSpaces": true,
|
"editor.insertSpaces": true,
|
||||||
"editor.tabSize": 4
|
"editor.tabSize": 4,
|
||||||
|
"cSpell.words": [
|
||||||
|
"Objs",
|
||||||
|
"precache",
|
||||||
|
"precaching",
|
||||||
|
"renderprops",
|
||||||
|
"todos"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
export const ADD_LIST = "ADD_LIST";
|
export const ADD_LIST = "ADD_LIST";
|
||||||
export const REMOVE_LIST = "REMOVE_LIST";
|
export const REMOVE_LIST = "REMOVE_LIST";
|
||||||
export const EDIT_LIST_NAME = "EDIT_LIST_NAME";
|
export const EDIT_LIST_NAME = "EDIT_LIST_NAME";
|
||||||
export const RECIEVE_LISTS = "RECIEVE_LISTS";
|
export const RECEIVE_LISTS = "RECEIVE_LISTS";
|
||||||
export const REQUEST_LISTS = "REQUEST_LISTS";
|
export const REQUEST_LISTS = "REQUEST_LISTS";
|
||||||
export const INVALIDATE_LISTS = "INVALIDATE_LISTS";
|
export const INVALIDATE_LISTS = "INVALIDATE_LISTS";
|
||||||
export const VALIDATE_LISTS = "VALIDATE_LISTS";
|
export const VALIDATE_LISTS = "VALIDATE_LISTS";
|
||||||
@@ -16,7 +16,7 @@ export const REMOVE_TODO = "REMOVE_TODO";
|
|||||||
export const TOGGLE_TODO = "TOGGLE_TODO";
|
export const TOGGLE_TODO = "TOGGLE_TODO";
|
||||||
export const EDIT_TODO = "EDIT_TODO";
|
export const EDIT_TODO = "EDIT_TODO";
|
||||||
export const SET_VISIBILITY_FILTER = "SET_VISIBILITY_FILTER";
|
export const SET_VISIBILITY_FILTER = "SET_VISIBILITY_FILTER";
|
||||||
export const RECIEVE_TODOS = "RECIEVE_TODOS";
|
export const RECEIVE_TODOS = "RECEIVE_TODOS";
|
||||||
export const REQUEST_TODOS = "REQUEST_TODOS";
|
export const REQUEST_TODOS = "REQUEST_TODOS";
|
||||||
export const INVALIDATE_TODOS = "INVALIDATE_TODOS";
|
export const INVALIDATE_TODOS = "INVALIDATE_TODOS";
|
||||||
export const VALIDATE_TODOS = "VALIDATE_TODOS";
|
export const VALIDATE_TODOS = "VALIDATE_TODOS";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
REQUEST_LISTS,
|
REQUEST_LISTS,
|
||||||
RECIEVE_LISTS,
|
RECEIVE_LISTS,
|
||||||
CHANGE_LIST,
|
CHANGE_LIST,
|
||||||
START_CREATE_LIST,
|
START_CREATE_LIST,
|
||||||
START_EDIT_LIST,
|
START_EDIT_LIST,
|
||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
INVALIDATE_LISTS,
|
INVALIDATE_LISTS,
|
||||||
REMOVE_LIST,
|
REMOVE_LIST,
|
||||||
EDIT_LIST_NAME,
|
EDIT_LIST_NAME,
|
||||||
RECIEVE_TODOS,
|
RECEIVE_TODOS,
|
||||||
} from "./defs";
|
} from "./defs";
|
||||||
|
|
||||||
import { API_ROOT, getToken, mongoObjectId } from "./util";
|
import { API_ROOT, getToken, mongoObjectId } from "./util";
|
||||||
@@ -18,8 +18,8 @@ import { API_ROOT, getToken, mongoObjectId } from "./util";
|
|||||||
function requestLists() {
|
function requestLists() {
|
||||||
return { type: REQUEST_LISTS };
|
return { type: REQUEST_LISTS };
|
||||||
}
|
}
|
||||||
function recieveLists(lists) {
|
function receiveLists(lists) {
|
||||||
return { type: RECIEVE_LISTS, lists };
|
return { type: RECEIVE_LISTS, lists };
|
||||||
}
|
}
|
||||||
export function changeList(list) {
|
export function changeList(list) {
|
||||||
return { type: CHANGE_LIST, list };
|
return { type: CHANGE_LIST, list };
|
||||||
@@ -156,7 +156,7 @@ export function fetchLists() {
|
|||||||
return newObj;
|
return newObj;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
dispatch({ type: RECIEVE_TODOS, todos: normalizeTodos(lists) });
|
dispatch({ type: RECEIVE_TODOS, todos: normalizeTodos(lists) });
|
||||||
dispatch(recieveLists(listsObj));
|
dispatch(receiveLists(listsObj));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
REQUEST_TODOS,
|
REQUEST_TODOS,
|
||||||
RECIEVE_TODOS,
|
RECEIVE_TODOS,
|
||||||
ADD_TODO,
|
ADD_TODO,
|
||||||
REMOVE_TODO,
|
REMOVE_TODO,
|
||||||
TOGGLE_TODO,
|
TOGGLE_TODO,
|
||||||
@@ -20,7 +20,7 @@ export function fetchTodos() {
|
|||||||
});
|
});
|
||||||
const json = await response.json();
|
const json = await response.json();
|
||||||
const todos = json.data;
|
const todos = json.data;
|
||||||
dispatch({ type: RECIEVE_TODOS, todos });
|
dispatch({ type: RECEIVE_TODOS, todos });
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,25 +12,22 @@ import todoApp from "./reducers";
|
|||||||
import { setToken } from "./actions/util";
|
import { setToken } from "./actions/util";
|
||||||
import keepSynced from "./middleware/keepSynced";
|
import keepSynced from "./middleware/keepSynced";
|
||||||
|
|
||||||
let store;
|
const store = createStore(
|
||||||
|
|
||||||
const persistCallback = () => {
|
|
||||||
const state = store.getState();
|
|
||||||
if (state.user.user) {
|
|
||||||
setToken(state.user.user.jwt);
|
|
||||||
}
|
|
||||||
ReactDOM.render(
|
|
||||||
<Provider store={store}>
|
|
||||||
<AppContainer />
|
|
||||||
</Provider>,
|
|
||||||
document.getElementById("root"),
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
store = createStore(
|
|
||||||
todoApp,
|
todoApp,
|
||||||
compose(
|
compose(
|
||||||
offline({ ...offlineConfig, persistCallback }),
|
offline({ ...offlineConfig, persistCallback: () => {
|
||||||
|
const state = store.getState();
|
||||||
|
if (state.user.user) {
|
||||||
|
setToken(state.user.user.jwt);
|
||||||
|
}
|
||||||
|
ReactDOM.render(
|
||||||
|
<Provider store={store}>
|
||||||
|
<AppContainer />
|
||||||
|
</Provider>,
|
||||||
|
document.getElementById("root"),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}),
|
||||||
applyMiddleware(thunk, keepSynced),
|
applyMiddleware(thunk, keepSynced),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
INVALIDATE_LISTS,
|
INVALIDATE_LISTS,
|
||||||
VALIDATE_LISTS,
|
VALIDATE_LISTS,
|
||||||
REQUEST_LISTS,
|
REQUEST_LISTS,
|
||||||
RECIEVE_LISTS,
|
RECEIVE_LISTS,
|
||||||
ADD_LIST,
|
ADD_LIST,
|
||||||
REMOVE_LIST,
|
REMOVE_LIST,
|
||||||
EDIT_LIST_NAME,
|
EDIT_LIST_NAME,
|
||||||
@@ -41,7 +41,7 @@ export default function lists(
|
|||||||
};
|
};
|
||||||
case CHANGE_LIST:
|
case CHANGE_LIST:
|
||||||
return { ...state, list: action.list };
|
return { ...state, list: action.list };
|
||||||
case RECIEVE_LISTS: {
|
case RECEIVE_LISTS: {
|
||||||
const newLists = Object.values(action.lists);
|
const newLists = Object.values(action.lists);
|
||||||
let { list } = state;
|
let { list } = state;
|
||||||
if (newLists.length !== 0) {
|
if (newLists.length !== 0) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
ADD_TODO,
|
ADD_TODO,
|
||||||
REMOVE_TODO,
|
REMOVE_TODO,
|
||||||
TOGGLE_TODO,
|
TOGGLE_TODO,
|
||||||
RECIEVE_TODOS,
|
RECEIVE_TODOS,
|
||||||
REQUEST_TODOS,
|
REQUEST_TODOS,
|
||||||
INVALIDATE_TODOS,
|
INVALIDATE_TODOS,
|
||||||
VALIDATE_TODOS,
|
VALIDATE_TODOS,
|
||||||
@@ -26,7 +26,7 @@ export default function todos(
|
|||||||
fetching: false,
|
fetching: false,
|
||||||
todos: null,
|
todos: null,
|
||||||
};
|
};
|
||||||
case RECIEVE_TODOS:
|
case RECEIVE_TODOS:
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
dirty: false,
|
dirty: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user