1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-13 11:29:53 +03:00

Pass FC.CONFIG as reference

This commit is contained in:
Pawel Spychalski (DzikuVx) 2024-05-10 14:37:39 +02:00
parent 1f3c55b075
commit a1f51b866f
2 changed files with 8 additions and 31 deletions

View file

@ -24,17 +24,17 @@ function zeroPad(value, width) {
return value;
}
function generateFilename(prefix, suffix) { // TODO, code used directly in cli.js instead
function generateFilename(config, prefix, suffix) {
var date = new Date();
var filename = prefix;
if (CONFIG) {
if (CONFIG.flightControllerIdentifier) {
filename = CONFIG.flightControllerIdentifier + '_' + CONFIG.flightControllerVersion + "_" + filename;
if (config) {
if (config.flightControllerIdentifier) {
filename = config.flightControllerIdentifier + '_' + config.flightControllerVersion + "_" + filename;
}
if (CONFIG.name && CONFIG.name.trim() !== '') {
filename = filename + '_' + CONFIG.name.trim().replace(' ', '_');
if (config.name && config.name.trim() !== '') {
filename = filename + '_' + config.name.trim().replace(' ', '_');
}
}