Skip to content

Commit 321d1a7

Browse files
Merge pull request #9 from oslabs-beta/garrett/allstate
fixes a couple payloads and ignores some actions in the configure store
2 parents cdd3024 + 64415dd commit 321d1a7

File tree

6 files changed

+32
-8
lines changed

6 files changed

+32
-8
lines changed

app/src/Dashboard/NavbarDash.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const StyledMenu = withStyles({
5050
})(props => (
5151
<Menu
5252
elevation={0}
53-
getContentAnchorEl={null}
53+
// getContentAnchorEl={null}
5454
anchorOrigin={{
5555
vertical: 'bottom',
5656
horizontal: 'center'

app/src/components/App.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export const App = (): JSX.Element => {
1818
// const [state, dispatch] = useReducer(reducer, initialState);
1919
const state = useSelector(store => store.appState);
2020
const dispatch = useDispatch();
21-
console.log("loaded right away")
2221
// checks if user is signed in as guest or actual user and changes loggedIn boolean accordingly
2322
useEffect(()=>{
2423
if (window.localStorage.getItem('ssid') !== 'guest') {
@@ -42,7 +41,7 @@ export const App = (): JSX.Element => {
4241
// type: 'SET INITIAL STATE',
4342
// payload: project
4443
// });
45-
dispatch(setInitialState({project}))
44+
dispatch(setInitialState(project))
4645
}
4746
});
4847
} else {
@@ -60,7 +59,7 @@ export const App = (): JSX.Element => {
6059
// type: 'SET INITIAL STATE',
6160
// payload: project
6261
// });
63-
dispatch(setInitialState({project}))
62+
dispatch(setInitialState(project))
6463
} else {
6564
console.log(
6665
'No user project found in localforage, setting initial state blank'

app/src/components/left/HTMLPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const HTMLPanel = (props): JSX.Element => {
111111
// type: 'ADD ELEMENT',
112112
// payload: newElement
113113
// });
114-
dispatch(addElement({newElement}))
114+
dispatch(addElement(newElement))
115115
setCurrentID(currentID + 1);
116116
setTag('');
117117
setName('');

app/src/components/main/DeleteButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DeleteButtons } from '../../interfaces/Interfaces';
33
import Modal from '@mui/material/Modal';
44
import StateContext from '../../context/context';
55
import { useDispatch } from 'react-redux';
6-
import { changeFocus, addChild, deleteChild } from '../../redux/reducers/slice/appStateSlice';
6+
import { deleteChild } from '../../redux/reducers/slice/appStateSlice';
77

88
function DeleteButton({ id, name }: DeleteButtons) {
99
// const [state, dispatch] = useContext(StateContext);

app/src/components/top/NavBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const StyledMenu = withStyles({
6262
})(props => (
6363
<Menu
6464
elevation={0}
65-
getContentAnchorEl={null}
65+
// getContentAnchorEl={null}
6666
anchorOrigin={{
6767
vertical: 'bottom',
6868
horizontal: 'center'

app/src/redux/store.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,32 @@ import { configureStore } from '@reduxjs/toolkit';
44
import rootReducer from './reducers/rootReducer';
55

66
const store = configureStore({
7-
reducer: rootReducer
7+
reducer: rootReducer,
8+
middleware: getDefaultMiddleware => {
9+
const ignoredPaths = [];
10+
11+
for (let i = 0; i < 21; i++) {
12+
ignoredPaths.push(`appState.HTMLTypes.${i}.icon`);
13+
ignoredPaths.push(`appState.HTMLTypes.${i}.icon.$$typeof`);
14+
}
15+
16+
return getDefaultMiddleware({
17+
serializableCheck: {
18+
// Ignore the `configToggle` action type
19+
// ignoredActions: ['configToggle'],
20+
// Ignore these field paths in all actions
21+
// ignoredActionPaths: ['meta.arg', 'payload.timestamp'],
22+
// Ignore these paths in the state
23+
ignoredPaths: ignoredPaths,
24+
},
25+
});
26+
},
827
});
928

29+
30+
31+
32+
33+
34+
1035
export default store;

0 commit comments

Comments
 (0)