little fix...

This commit is contained in:
2026-01-16 10:39:06 +08:00
parent f9b2f35828
commit c56780570a
2 changed files with 1 additions and 11 deletions

View File

@@ -67,14 +67,8 @@ class Amily2Bus {
};
}
}
// 挂载全局单例
if (!window.Amily2Bus) {
window.Amily2Bus = new Amily2Bus();
}
export function initializeAmilyBus() {
if (!window.Amily2Bus) {
if (!window.Amily2Bus || !(window.Amily2Bus instanceof Amily2Bus)) {
window.Amily2Bus = new Amily2Bus();
console.log('[Amily2] Amily2Bus 已成功初始化并附加到 window 对象');
}

View File

@@ -210,8 +210,4 @@ class Logger {
}
// Ensure Amily2Bus namespace exists to prevent crash if loaded out of order
window.Amily2Bus = window.Amily2Bus || {};
window.Amily2Bus.Logger = new Logger();
export default Logger;