mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 10:00:17 +05:30
fix(modal): prevent duplicate ModalManager declaration
window.ModalManager was set unconditionally, causing "Identifier 'ModalManager' has already been declared" when script tag in HTML also loaded ModalManager before renderer.js required it. Now checks !window.ModalManager before setting. Amit Haridas
This commit is contained in:
@@ -237,8 +237,8 @@ class ModalManager {
|
||||
}
|
||||
}
|
||||
|
||||
// Export for use in renderer
|
||||
if (typeof window !== 'undefined') {
|
||||
// Export for use in renderer - avoid duplicate declaration
|
||||
if (typeof window !== 'undefined' && !window.ModalManager) {
|
||||
window.ModalManager = ModalManager;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user