mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
18 lines
448 B
TypeScript
18 lines
448 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>
|
|
) =>
|
|
userPreferencesRepository.upsert(
|
|
{
|
|
id: 1,
|
|
...preferences,
|
|
},
|
|
["id"]
|
|
);
|
|
|
|
registerEvent("updateUserPreferences", updateUserPreferences);
|