@@ -21,7 +21,7 @@ import {
2121 addNotebook ,
2222 setActiveNotebookTabNumber ,
2323 updateActiveNotebookName ,
24- setNotebookIsSaving
24+ setNotebookSavingStatus ,
2525} from "../../lib/state/reducer"
2626import { useDispatch , useSelector } from 'react-redux' ;
2727import { AppState } from '../../lib/typings/types' ;
@@ -47,12 +47,12 @@ export default function FileMenu() {
4747 }
4848
4949 const handleSaveFile = async ( ) => {
50- dispatch ( setNotebookIsSaving ( true ) )
50+ dispatch ( setNotebookSavingStatus ( "saving" ) )
5151 const currentNotebook = notebooks [ activeNotebookName ]
5252 const fileHandle = currentNotebook . metadata ?. fileHandle
5353 const contents = JSON . stringify ( currentNotebook )
5454 await saveNotebookToFileSystem ( fileHandle , contents )
55- dispatch ( setNotebookIsSaving ( false ) )
55+ dispatch ( setNotebookSavingStatus ( "saved" ) )
5656 }
5757
5858 const downloadActiveNotebook = async ( ) => {
@@ -82,7 +82,7 @@ export default function FileMenu() {
8282 ⌘O
8383 </ Typography >
8484 </ MenuItem >
85- < MenuItem >
85+ < MenuItem disabled = { activeNotebookName === "Dashboard" } >
8686 < ListItemIcon >
8787 < DriveFileRenameOutlineIcon fontSize = "small" />
8888 </ ListItemIcon >
@@ -91,7 +91,7 @@ export default function FileMenu() {
9191 ⌘R
9292 </ Typography >
9393 </ MenuItem >
94- < MenuItem onClick = { ( ) => handleSaveFile ( ) } >
94+ < MenuItem onClick = { ( ) => handleSaveFile ( ) } disabled = { activeNotebookName === "Dashboard" } >
9595 < ListItemIcon >
9696 < SaveIcon fontSize = "small" />
9797 </ ListItemIcon >
@@ -100,7 +100,7 @@ export default function FileMenu() {
100100 ⌘S
101101 </ Typography >
102102 </ MenuItem >
103- < MenuItem onClick = { ( ) => downloadActiveNotebook ( ) } >
103+ < MenuItem onClick = { ( ) => downloadActiveNotebook ( ) } disabled = { activeNotebookName === "Dashboard" } >
104104 < ListItemIcon >
105105 < SaveAltIcon fontSize = "small" />
106106 </ ListItemIcon >
@@ -109,7 +109,7 @@ export default function FileMenu() {
109109 ⌘D
110110 </ Typography >
111111 </ MenuItem >
112- < MenuItem >
112+ < MenuItem disabled = { activeNotebookName === "Dashboard" } >
113113 < ListItemIcon >
114114 < ImportExportIcon fontSize = "small" />
115115 </ ListItemIcon >
0 commit comments