Skip to content

Commit 741d17c

Browse files
committed
Add download status option
1 parent 7a0727f commit 741d17c

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

src/frontend/components/IconMenu/file.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ export default function FileMenu() {
5656
}
5757

5858
const downloadActiveNotebook = async () => {
59+
dispatch(setNotebookSavingStatus("downloading"))
5960
const currentNotebook = {...notebooks[activeNotebookName]}
6061
await downloadAsNewNotebook(currentNotebook)
62+
dispatch(setNotebookSavingStatus("downloaded"))
6163
}
6264

6365

src/frontend/components/MenuBar/saveStatusLabel.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { NotebookSaveStatus } from "../../lib/typings/types";
22
import { Chip } from "@mui/material";
33
import CheckIcon from '@mui/icons-material/Check';
4+
import { FileDownload } from "@mui/icons-material";
45

56
export default function SaveStatusLabel({ notebookStatus }: { notebookStatus: NotebookSaveStatus }) {
67
switch (notebookStatus) {
@@ -23,6 +24,26 @@ export default function SaveStatusLabel({ notebookStatus }: { notebookStatus: No
2324
label={"* Not Saved"}
2425
color='secondary'
2526
/>
27+
case "error":
28+
return <Chip
29+
size='small'
30+
label={"Error"}
31+
color='error'
32+
/>
33+
case "downloading":
34+
return <Chip
35+
size='small'
36+
label={"Downloading..."}
37+
color='info'
38+
icon={<FileDownload />}
39+
/>
40+
case "downloaded":
41+
return <Chip
42+
size='small'
43+
label={"Downloaded"}
44+
color='success'
45+
icon={<CheckIcon />}
46+
/>
2647
default:
2748
return <div></div>
2849
}

src/frontend/lib/typings/types.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export type CellLanguages = {
5959
}
6060
}
6161

62-
export type NotebookSaveStatus = "unsaved" | "saving" | "saved";
62+
export type NotebookSaveStatus = "unsaved" | "saving" | "saved" | "error" | "downloading" | "downloaded"
6363

6464
export type AppState = {
6565
interpreterMode: string;

0 commit comments

Comments
 (0)