Skip to content

Commit 09bab3a

Browse files
authored
fix quick actions (codesandbox#2876)
1 parent d9ad79c commit 09bab3a

File tree

1 file changed

+6
-8
lines changed
  • packages/app/src/app/pages/Sandbox/QuickActions

1 file changed

+6
-8
lines changed

packages/app/src/app/pages/Sandbox/QuickActions/index.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ export const QuickActions: React.FunctionComponent = () => {
2929
actions: { editor },
3030
} = useOvermind();
3131

32+
const persistGenie = () => {
33+
const { enteredMagicWords } = genie.options();
34+
window.localStorage.setItem('genie', JSON.stringify({ enteredMagicWords }));
35+
};
36+
3237
const loadGenie = useCallback(() => {
3338
try {
3439
const { enteredMagicWords } = JSON.parse(
@@ -45,9 +50,7 @@ export const QuickActions: React.FunctionComponent = () => {
4550

4651
const updateGenie = useCallback(() => {
4752
Object.keys(keybindings).forEach(bindingKey => {
48-
const {
49-
quickAction: { type, title, signal, payload },
50-
} = keybindings[bindingKey];
53+
const { type, title, signal, payload } = keybindings[bindingKey];
5154

5255
genie({
5356
magicWords: `${type}: ${title}`,
@@ -91,11 +94,6 @@ export const QuickActions: React.FunctionComponent = () => {
9194
editor.quickActionsClosed();
9295
};
9396

94-
const persistGenie = () => {
95-
const { enteredMagicWords } = genie.options();
96-
window.localStorage.setItem('genie', JSON.stringify({ enteredMagicWords }));
97-
};
98-
9997
let inputVal = '';
10098
const onChange = item => {
10199
genie.makeWish(item, inputVal);

0 commit comments

Comments
 (0)