aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/editor/EditorButtons.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/frontend/src/editor/EditorButtons.tsx')
-rw-r--r--subprojects/frontend/src/editor/EditorButtons.tsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/subprojects/frontend/src/editor/EditorButtons.tsx b/subprojects/frontend/src/editor/EditorButtons.tsx
index d2273c6c..fd046d46 100644
--- a/subprojects/frontend/src/editor/EditorButtons.tsx
+++ b/subprojects/frontend/src/editor/EditorButtons.tsx
@@ -15,6 +15,7 @@ import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
15import { observer } from 'mobx-react-lite'; 15import { observer } from 'mobx-react-lite';
16import React from 'react'; 16import React from 'react';
17 17
18import ConnectButton from './ConnectButton';
18import type EditorStore from './EditorStore'; 19import type EditorStore from './EditorStore';
19 20
20// Exhastive switch as proven by TypeScript. 21// Exhastive switch as proven by TypeScript.
@@ -93,13 +94,14 @@ export default observer(function EditorButtons({
93 </ToggleButton> 94 </ToggleButton>
94 </ToggleButtonGroup> 95 </ToggleButtonGroup>
95 <IconButton 96 <IconButton
96 disabled={editorStore === undefined} 97 disabled={editorStore === undefined || !editorStore.opened}
97 onClick={() => editorStore?.formatText()} 98 onClick={() => editorStore?.formatText()}
98 aria-label="Automatic format" 99 aria-label="Automatic format"
99 color="inherit" 100 color="inherit"
100 > 101 >
101 <FormatPaint fontSize="small" /> 102 <FormatPaint fontSize="small" />
102 </IconButton> 103 </IconButton>
104 <ConnectButton editorStore={editorStore} />
103 </Stack> 105 </Stack>
104 ); 106 );
105}); 107});