Skip to content

Commit d0d8640

Browse files
feat(ui): add reload schema button (#3252)
2 parents 2e9d1ea + e6158d1 commit d0d8640

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

invokeai/frontend/web/src/features/nodes/components/panels/TopCenterPanel.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import { HStack } from '@chakra-ui/react';
12
import { useAppDispatch } from 'app/storeHooks';
23
import IAIButton from 'common/components/IAIButton';
34
import { memo, useCallback } from 'react';
45
import { Panel } from 'reactflow';
6+
import { receivedOpenAPISchema } from 'services/thunks/schema';
57
import { nodesGraphBuilt } from 'services/thunks/session';
68

79
const TopCenterPanel = () => {
@@ -11,11 +13,18 @@ const TopCenterPanel = () => {
1113
dispatch(nodesGraphBuilt());
1214
}, [dispatch]);
1315

16+
const handleReloadSchema = useCallback(() => {
17+
dispatch(receivedOpenAPISchema());
18+
}, [dispatch]);
19+
1420
return (
1521
<Panel position="top-center">
16-
<IAIButton colorScheme="accent" onClick={handleInvoke}>
17-
Will it blend?
18-
</IAIButton>
22+
<HStack>
23+
<IAIButton colorScheme="accent" onClick={handleInvoke}>
24+
Will it blend?
25+
</IAIButton>
26+
<IAIButton onClick={handleReloadSchema}>Reload Schema</IAIButton>
27+
</HStack>
1928
</Panel>
2029
);
2130
};

0 commit comments

Comments
 (0)