Skip to content

Commit

Permalink
vuexのstoreの呼び出しをリテラル引数からDot記法へ: composables, plugins (#2331)
Browse files Browse the repository at this point in the history
  • Loading branch information
Segu-g authored Oct 28, 2024
1 parent 9ba51de commit 31f04d3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/composables/useLyricInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const useLyricInput = () => {
newNotes.push({ ...note, lyric });
}
previewLyrics.value = new Map();
void store.dispatch("COMMAND_UPDATE_NOTES", {
void store.actions.COMMAND_UPDATE_NOTES({
notes: newNotes,
trackId: store.getters.SELECTED_TRACK_ID,
});
Expand Down
2 changes: 1 addition & 1 deletion src/composables/useRootMiscSetting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const useRootMiscSetting = <T extends keyof RootMiscSettingType>(
const setter = (value: RootMiscSettingType[T]) => {
// Vuexの型処理でUnionが解かれてしまうのを迂回している
// FIXME: このワークアラウンドをなくす
void store.dispatch("SET_ROOT_MISC_SETTING", {
void store.actions.SET_ROOT_MISC_SETTING({
key: key as never,
value,
});
Expand Down
18 changes: 9 additions & 9 deletions src/plugins/ipcMessageReceiverPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ export const ipcMessageReceiver: Plugin = {
) => {
window.backend.onReceivedIPCMsg({
LOAD_PROJECT_FILE: (_, { filePath, confirm } = {}) =>
void options.store.dispatch("LOAD_PROJECT_FILE", { filePath, confirm }),
void options.store.actions.LOAD_PROJECT_FILE({ filePath, confirm }),

DETECT_MAXIMIZED: () => options.store.dispatch("DETECT_MAXIMIZED"),
DETECT_MAXIMIZED: () => options.store.actions.DETECT_MAXIMIZED(),

DETECT_UNMAXIMIZED: () => options.store.dispatch("DETECT_UNMAXIMIZED"),
DETECT_UNMAXIMIZED: () => options.store.actions.DETECT_UNMAXIMIZED(),

DETECTED_ENGINE_ERROR: (_, { engineId }) =>
options.store.dispatch("DETECTED_ENGINE_ERROR", { engineId }),
options.store.actions.DETECTED_ENGINE_ERROR({ engineId }),

DETECT_PINNED: () => {
void options.store.dispatch("DETECT_PINNED");
void options.store.actions.DETECT_PINNED();
},

DETECT_UNPINNED: () => {
void options.store.dispatch("DETECT_UNPINNED");
void options.store.actions.DETECT_UNPINNED();
},

DETECT_ENTER_FULLSCREEN: () =>
options.store.dispatch("DETECT_ENTER_FULLSCREEN"),
options.store.actions.DETECT_ENTER_FULLSCREEN(),

DETECT_LEAVE_FULLSCREEN: () =>
options.store.dispatch("DETECT_LEAVE_FULLSCREEN"),
options.store.actions.DETECT_LEAVE_FULLSCREEN(),

CHECK_EDITED_AND_NOT_SAVE: (_, obj) => {
void options.store.dispatch("CHECK_EDITED_AND_NOT_SAVE", obj);
void options.store.actions.CHECK_EDITED_AND_NOT_SAVE(obj);
},

DETECT_RESIZED: debounce(
Expand Down

0 comments on commit 31f04d3

Please sign in to comment.