Skip to content

Commit

Permalink
await追加&コードを周りに合わせた
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba committed Mar 22, 2024
1 parent 7f068bd commit 15d2de6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
14 changes: 8 additions & 6 deletions src/components/Menu/MenuBar/BaseMenuBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -342,19 +342,21 @@ const menudata = computed<MenuItemData[]>(() => [
{
type: "button",
label: "元に戻す",
onClick: () => {
if (uiLocked.value) return;
store.dispatch("UNDO", { editor: props.editor });
onClick: async () => {
if (!uiLocked.value) {
await store.dispatch("UNDO", { editor: props.editor });
}
},
disabled: !canUndo.value,
disableWhenUiLocked: true,
},
{
type: "button",
label: "やり直す",
onClick: () => {
if (uiLocked.value) return;
store.dispatch("REDO", { editor: props.editor });
onClick: async () => {
if (!uiLocked.value) {
await store.dispatch("REDO", { editor: props.editor });
}
},
disabled: !canRedo.value,
disableWhenUiLocked: true,
Expand Down
6 changes: 3 additions & 3 deletions src/store/singing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2024,9 +2024,9 @@ export const singingStore = createPartialStore<SingingStoreTypes>({
},

COMMAND_CUT_NOTES_TO_CLIPBOARD: {
action({ dispatch }) {
dispatch("COPY_NOTES_TO_CLIPBOARD");
dispatch("COMMAND_REMOVE_SELECTED_NOTES");
async action({ dispatch }) {
await dispatch("COPY_NOTES_TO_CLIPBOARD");
await dispatch("COMMAND_REMOVE_SELECTED_NOTES");
},
},

Expand Down

0 comments on commit 15d2de6

Please sign in to comment.