Skip to content

Commit 23d81ad

Browse files
committed
fix reset state to include name reset and warning about project name
1 parent 33afc67 commit 23d81ad

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

app/src/components/right/ProjectManager.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,15 @@ const ProjectManager = () => {
157157
return (
158158
// <div className={classes.logoutButton}>
159159
<div className={classes.projectManagerWrapper}>
160+
{state.name ? (
161+
<p>You are currently working on {state.name}</p>
162+
) : (
163+
<p>
164+
Your project does not have a name, please give it name for it to be
165+
saved!!!
166+
</p>
167+
)}
168+
160169
<div className={classes.projectTypeWrapper}>
161170
<FormControl>
162171
<Select

app/src/reducers/componentReducer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ 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 = '';
327328
const nextChildId = 1;
328329
const rootComponents = [1];
329330
const nextComponentId = 2;
@@ -341,6 +342,7 @@ const reducer = (state: State, action: Action) => {
341342
const components = [rootComponent];
342343
return {
343344
...state,
345+
name,
344346
nextChildId,
345347
rootComponents,
346348
nextComponentId,

0 commit comments

Comments
 (0)