mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 19:54:39 +00:00
fix live image variable renaming
This commit is contained in:
@@ -118,6 +118,12 @@ export const UpdateThemePreview = async (updatedTheme: CustomThemeBase64 /* Omit
|
||||
if (existingImage && existingImage.variableName !== image.variableName) {
|
||||
// Remove the previous variableName from the document
|
||||
removeImageFromDocument(existingImage.variableName);
|
||||
|
||||
// Update the variableName in imageData
|
||||
imageData[image.id].variableName = image.variableName;
|
||||
|
||||
// Update the variableName in the document
|
||||
document.documentElement.style.setProperty('--' + image.variableName, `url(${existingImage.url})`);
|
||||
}
|
||||
|
||||
if (image.url) {
|
||||
@@ -128,7 +134,7 @@ export const UpdateThemePreview = async (updatedTheme: CustomThemeBase64 /* Omit
|
||||
}
|
||||
|
||||
imageData[image.id] = {
|
||||
url: '',
|
||||
url: imageData[image.id]?.url || '',
|
||||
variableName: image.variableName,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user