Skip to content

Commit 3cd6a54

Browse files
committed
complete delete project functionality, server reintegration
1 parent c3f9ccf commit 3cd6a54

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

app/src/components/right/DeleteProjects.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
} from '../../helperFunctions/projectGetSaveDel';
1818
import localforage from 'localforage';
1919
import { stateContext } from '../../context/context';
20+
import initialState from '../../context/initialState';
2021

2122
export interface ProjectDialogProps {
2223
open: boolean;
@@ -44,7 +45,7 @@ function ProjectsDialog(props: ProjectDialogProps) {
4445
console.log('selectedProject is', selectedProject);
4546
deleteProject(selectedProject);
4647
localforage.clear();
47-
dispatch({ type: 'RESET STATE', payload: {} });
48+
dispatch({ type: 'SET INITIAL STATE', payload: initialState });
4849
onClose();
4950
};
5051

app/src/reducers/componentReducer.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ const reducer = (state: State, action: Action) => {
324324
}
325325
// Reset all component data back to their initial state but maintain the user's project name and log-in status
326326
case 'RESET STATE': {
327-
const name = '';
328327
const nextChildId = 1;
329328
const rootComponents = [1];
330329
const nextComponentId = 2;
@@ -342,7 +341,6 @@ const reducer = (state: State, action: Action) => {
342341
const components = [rootComponent];
343342
return {
344343
...state,
345-
name,
346344
nextChildId,
347345
rootComponents,
348346
nextComponentId,

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,9 @@
114114
"immutable": "^4.0.0-rc.12",
115115
"js-cookie": "^2.2.1",
116116
"localforage": "^1.7.2",
117-
<<<<<<< HEAD
118117
"passport": "^0.4.1",
119118
"passport-github2": "^0.1.12",
120-
=======
121119
"node-fetch": "^2.6.0",
122-
>>>>>>> master
123120
"prettier": "^1.19.1",
124121
"prop-types": "^15.6.2",
125122
"react": "^16.13.0",

0 commit comments

Comments
 (0)