This commit is contained in:
2026-01-27 23:05:14 +03:00
parent 761a3f6d31
commit 866ddf9a1a
2 changed files with 63 additions and 13 deletions

View File

@ -372,9 +372,19 @@
if (typeof lucide !== 'undefined') {
document.addEventListener('DOMContentLoaded', () => {
lucide.createIcons();
// Обновляем иконки при изменении DOM
// Обновляем иконки при изменении DOM с debounce, чтобы избежать бесконечного цикла
let iconUpdateTimer = null;
const observer = new MutationObserver(() => {
lucide.createIcons();
// Отменяем предыдущий таймер
if (iconUpdateTimer) clearTimeout(iconUpdateTimer);
// Устанавливаем новый таймер с задержкой
iconUpdateTimer = setTimeout(() => {
try {
lucide.createIcons();
} catch (e) {
console.warn('Error updating Lucide icons:', e);
}
}, 200);
});
observer.observe(document.body, { childList: true, subtree: true });
});