mirror of
https://github.com/dscalzi/HeliosLauncher.git
synced 2024-12-22 03:32:12 -08:00
Refactor menu visibility logic in athshield.js
Separate logic for 'cacher' and 'bloquer' options and update corresponding values to 'hidden' and 'blocked' respectively. Ensure configuration is saved after setting the menu visibility.
This commit is contained in:
parent
fc5a2d4b8d
commit
96e0ca12f4
@ -44,17 +44,21 @@ function startCLI() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (menuAnswer.toLowerCase() === 'cacher' || menuAnswer.toLowerCase() === 'bloquer') {
|
if (menuAnswer.toLowerCase() === 'cacher') {
|
||||||
config.menuVisibility = menuAnswer.toLowerCase()
|
config.menuVisibility = 'hidden' // Change to 'hidden'
|
||||||
console.log(`Athena's Shield activé. Menu ${config.menuVisibility === 'cacher' ? 'caché' : 'bloqué'}.`)
|
console.log(`Athena's Shield activé. Menu caché.`)
|
||||||
|
} else if (menuAnswer.toLowerCase() === 'bloquer') {
|
||||||
|
config.menuVisibility = 'blocked' // Change to 'blocked'
|
||||||
|
console.log(`Athena's Shield activé. Menu bloqué.`)
|
||||||
|
} else {
|
||||||
|
console.log('Option non valide pour le menu.')
|
||||||
|
rl.close()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Sauvegarder la configuration modifiée
|
// Sauvegarder la configuration modifiée
|
||||||
saveConfig(config)
|
saveConfig(config)
|
||||||
rl.close()
|
rl.close()
|
||||||
} else {
|
|
||||||
console.log('Option non valide pour le menu.')
|
|
||||||
rl.close()
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
} else if (answer.toLowerCase() === 'non') {
|
} else if (answer.toLowerCase() === 'non') {
|
||||||
console.log('Athena\'s Shield non activé. Fermeture du CLI.')
|
console.log('Athena\'s Shield non activé. Fermeture du CLI.')
|
||||||
|
Loading…
Reference in New Issue
Block a user