Improve comments in profileManager.js

Refactor comments for clarity and conciseness in profileManager.js.
This commit is contained in:
Rahul Sahani
2026-01-20 11:57:01 +05:30
committed by GitHub
parent 727be2ca5c
commit c2d5536dd0

View File

@@ -7,9 +7,8 @@ const {
getModsPath getModsPath
} = require('../core/config'); } = require('../core/config');
// We'll lazy-load modManager to avoid circular dependencies if possible, // Lazy-load modManager to avoid circular deps, or keep imports structured.
// or carefully structure our imports. // For now, access mod paths directly or use helper helpers.
// For now, we might need to access mod paths directly or use helper functions.
class ProfileManager { class ProfileManager {
constructor() { constructor() {
@@ -57,10 +56,9 @@ class ProfileManager {
[defaultProfileId]: defaultProfile [defaultProfileId]: defaultProfile
}, },
activeProfileId: defaultProfileId, activeProfileId: defaultProfileId,
// We keep a global registry of "known" mods if we want, // Mods are currently treated as files on disk.
// but for now the current implementation implies // The profile's `mods` array is the source of truth for enabled/known mods per profile.
// mods are just files in folders.
// We'll use the profile "mods" array to track ENABLED/KNOWN mods for that profile.
}; };
saveConfig(updates); saveConfig(updates);
@@ -196,10 +194,9 @@ class ProfileManager {
// If we updated mods for the *active* profile, we might need to sync immediately // If we updated mods for the *active* profile, we might need to sync immediately
if (config.activeProfileId === id && updates.mods) { if (config.activeProfileId === id && updates.mods) {
// Optionally trigger sync? // Optionally trigger sync?
// Usually updates come from "Enabling/Disabling" a single mod, // Sync is usually triggered when toggling a single mod.
// which might call a more specific method. // For bulk updates, the caller should decide when to sync.
// But if we bulk update, we should sync.
// Let's leave sync invoke to the caller or specific methods for now.
} }
return profiles[id]; return profiles[id];