mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-18 00:33:59 +00:00
feat: adding dynamic dir to get steam user id
This commit is contained in:
@@ -54,7 +54,7 @@ const createSteamShortcut = async (
|
||||
`/games/stats?objectId=${objectId}&shop=${shop}`
|
||||
);
|
||||
|
||||
const steamUserId = getSteamUserId();
|
||||
const steamUserId = await getSteamUserId();
|
||||
|
||||
if (!steamUserId) {
|
||||
logger.error("No Steam user ID found");
|
||||
|
||||
@@ -77,14 +77,12 @@ export const getSteamAppDetails = async (
|
||||
});
|
||||
};
|
||||
|
||||
export const getSteamUserId = () => {
|
||||
const userDataPath = path.join(
|
||||
SystemPath.getPath("appData"),
|
||||
"Steam",
|
||||
"userdata"
|
||||
);
|
||||
export const getSteamUserId = async () => {
|
||||
const userDataPath = await getSteamLocation();
|
||||
|
||||
const userIds = fs.readdirSync(userDataPath, { withFileTypes: true });
|
||||
const userIds = fs.readdirSync(path.join(userDataPath, "userdata"), {
|
||||
withFileTypes: true,
|
||||
});
|
||||
|
||||
const [steamUserId] = userIds.filter((dir) => dir.isDirectory());
|
||||
if (!steamUserId) {
|
||||
|
||||
Reference in New Issue
Block a user