mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
16 lines
456 B
TypeScript
16 lines
456 B
TypeScript
import { defaultDownloadsPath } from "@main/constants";
|
|
import { db, levelKeys } from "@main/level";
|
|
import type { UserPreferences } from "@types";
|
|
|
|
export const getDownloadsPath = async () => {
|
|
const userPreferences = await db.get<string, UserPreferences | null>(
|
|
levelKeys.userPreferences,
|
|
{
|
|
valueEncoding: "json",
|
|
}
|
|
);
|
|
|
|
if (userPreferences?.downloadsPath) return userPreferences.downloadsPath;
|
|
|
|
return defaultDownloadsPath;
|
|
};
|