mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
21 lines
472 B
TypeScript
21 lines
472 B
TypeScript
import { userPreferencesRepository } from "@main/repository";
|
|
import { registerEvent } from "../register-event";
|
|
|
|
import type { UserPreferences } from "@types";
|
|
|
|
const updateUserPreferences = async (
|
|
_event: Electron.IpcMainInvokeEvent,
|
|
preferences: Partial<UserPreferences>
|
|
) => {
|
|
await userPreferencesRepository.upsert(
|
|
{
|
|
id: 1,
|
|
...preferences,
|
|
},
|
|
["id"]
|
|
);
|
|
};
|
|
|
|
registerEvent(updateUserPreferences, {
|
|
name: "updateUserPreferences",
|
|
});
|