Skip to content

Commit

Permalink
変更
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba committed Jan 8, 2024
1 parent 8884d35 commit ba04a6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/store/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export const settingStore = createPartialStore<SettingStoreTypes>({

for (const key of rootMiscSettingKeys) {
commit("SET_ROOT_MISC_SETTING", {
// NOTE: Vuexの型処理でUnionが解かれてしまうのを迂回している
// Vuexの型処理でUnionが解かれてしまうのを迂回している
// FIXME: このワークアラウンドをなくす
key: key as never,
value: await window.electron.getSetting(key),
Expand Down Expand Up @@ -222,13 +222,13 @@ export const settingStore = createPartialStore<SettingStoreTypes>({

SET_ROOT_MISC_SETTING: {
mutation(state, { key, value }) {
// NOTE: Vuexの型処理でUnionが解かれてしまうのを迂回している
// Vuexの型処理でUnionが解かれてしまうのを迂回している
// FIXME: このワークアラウンドをなくす
state[key as never] = value;
},
action({ commit }, { key, value }) {
window.electron.setSetting(key, value);
// NOTE: Vuexの型処理でUnionが解かれてしまうのを迂回している
// Vuexの型処理でUnionが解かれてしまうのを迂回している
// FIXME: このワークアラウンドをなくす
commit("SET_ROOT_MISC_SETTING", { key: key as never, value });
},
Expand Down
6 changes: 3 additions & 3 deletions src/type/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ export type ConfirmedTips = {
};

// ルート直下にある雑多な設定値
export const RootMiscSettingSchema = z.object({
export const rootMiscSettingSchema = z.object({
editorFont: z.enum(["default", "os"]).default("default"),
showTextLineNumber: z.boolean().default(false),
showAddAudioItemButton: z.boolean().default(true),
Expand All @@ -519,7 +519,7 @@ export const RootMiscSettingSchema = z.object({
splitterPosition: splitterPositionSchema.default({}),
enableMultiEngine: z.boolean().default(false),
});
export type RootMiscSetting = z.infer<typeof RootMiscSettingSchema>;
export type RootMiscSetting = z.infer<typeof rootMiscSettingSchema>;

export const configSchema = z
.object({
Expand Down Expand Up @@ -602,7 +602,7 @@ export const configSchema = z
registeredEngineDirs: z.string().array().default([]),
recentlyUsedProjects: z.string().array().default([]),
})
.merge(RootMiscSettingSchema);
.merge(rootMiscSettingSchema);
export type ConfigType = z.infer<typeof configSchema>;

export const envEngineInfoSchema = z.object({
Expand Down

0 comments on commit ba04a6f

Please sign in to comment.