Refactor config path retrieval in landing.js

Remove unused dataPath constant and replace its usage in mod validation error message with ConfigManager.getNameDataPath(). This ensures the config path is retrieved dynamically.
This commit is contained in:
Sandro642 2024-10-24 23:40:14 +02:00
parent 48350019f2
commit 1f4df6b8ff

View File

@ -30,7 +30,6 @@ const {
// Internal Requirements // Internal Requirements
const DiscordWrapper = require('./assets/js/discordwrapper') const DiscordWrapper = require('./assets/js/discordwrapper')
const ProcessBuilder = require('./assets/js/processbuilder') const ProcessBuilder = require('./assets/js/processbuilder')
const dataPath = require('./assets/js/configmanager')
const fs = require('fs') const fs = require('fs')
// Launch Elements // Launch Elements
@ -614,7 +613,7 @@ async function dlAsync(login = true) {
// Perform mod validation before proceeding // Perform mod validation before proceeding
if (!validateMods()) { if (!validateMods()) {
const errorMessage = Lang.queryJS('landing.dlAsync.AthShield.invalidModsDetectedMessage', {'folder': dataPath}) const errorMessage = Lang.queryJS('landing.dlAsync.AthShield.invalidModsDetectedMessage', {'folder': ConfigManager.getNameDataPath()})
loggerLanding.error(errorMessage) loggerLanding.error(errorMessage)
showLaunchFailure(errorMessage, null) showLaunchFailure(errorMessage, null)
return return