feat: Add tagging functionality to logos and enhance logo modal display

This commit is contained in:
sHa
2025-04-28 11:51:43 +03:00
parent 5446646519
commit 51ea3c3dba
4 changed files with 271 additions and 19 deletions

View File

@@ -61,9 +61,10 @@ function scanLogos() {
const format = getFileExtension(file);
const logoPath = `logos/${file}`;
const existingItem = existingMap.get(logoPath);
let logoObj;
if (existingItem) {
// Preserve name and disable, update format/path
return {
// Preserve name, tags, and disable, update format/path
logoObj = {
...existingItem,
path: logoPath,
format: format,
@@ -71,13 +72,18 @@ function scanLogos() {
};
} else {
// New logo
return {
logoObj = {
name: formatName(file),
path: logoPath,
format: format,
disable: false
};
}
// Ensure tags field exists and is an array
if (!Array.isArray(logoObj.tags)) {
logoObj.tags = [];
}
return logoObj;
});
return logos;
} catch (error) {