mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: migrating user preferences
This commit is contained in:
parent
d760d0139d
commit
f1e0ba4dd6
53 changed files with 737 additions and 790 deletions
|
@ -1,12 +1,15 @@
|
|||
import { userPreferencesRepository } from "@main/repository";
|
||||
import { defaultDownloadsPath } from "@main/constants";
|
||||
import { levelKeys } from "@main/level";
|
||||
import type { UserPreferences } from "@types";
|
||||
import { db } from "@main/level";
|
||||
|
||||
export const getDownloadsPath = async () => {
|
||||
const userPreferences = await userPreferencesRepository.findOne({
|
||||
where: {
|
||||
id: 1,
|
||||
},
|
||||
});
|
||||
const userPreferences = await db.get<string, UserPreferences>(
|
||||
levelKeys.userPreferences,
|
||||
{
|
||||
valueEncoding: "json",
|
||||
}
|
||||
);
|
||||
|
||||
if (userPreferences && userPreferences.downloadsPath)
|
||||
return userPreferences.downloadsPath;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue