File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
heartbeat_monitor/src/jsMain Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -26,15 +26,13 @@ object KanbanBroFirebaseHeartbeatCardProviderPlugin : AbstractPlugin("KanbanBroF
2626
2727 if (user == null ) {
2828 console.warn(" No user logged in for app" , app.name)
29- window.asDynamic().scheduleUpdate()
3029 return
3130 }
3231
3332 val files = try {
3433 (listAll(ref(getStorage(app), " users/${user.uid} " )) as Promise < dynamic > ).await()
3534 } catch (e: dynamic ) {
3635 console.error(" Failed to list heartbeat roots" , e)
37- window.asDynamic().scheduleUpdate()
3836 return
3937 }
4038
@@ -109,7 +107,6 @@ object KanbanBroFirebaseHeartbeatCardProviderPlugin : AbstractPlugin("KanbanBroF
109107 }
110108 }
111109 }
112- window.asDynamic().scheduleUpdate()
113110 }
114111
115112 suspend fun rebuild () {
@@ -118,6 +115,8 @@ object KanbanBroFirebaseHeartbeatCardProviderPlugin : AbstractPlugin("KanbanBroF
118115 rebuildForApp(KanbanBro .firebase.getApp(appName), providers2)
119116 }
120117 providers = providers2
118+ window.asDynamic().scheduleUpdate()
119+ console.log(" [KanbanBroFirebaseHeartbeatCardProviderPlugin] Rebuilt: found ${providers.size} providers" )
121120 }
122121
123122 KanbanBro .cardProviders.push { signal: dynamic -> providers.map { p -> p(signal) }.toTypedArray() }
@@ -130,7 +129,7 @@ object KanbanBroFirebaseHeartbeatCardProviderPlugin : AbstractPlugin("KanbanBroF
130129 KanbanBro .appsEvent.addEventListener(" removed" , { e: dynamic ->
131130 unsubscribers[e.detail.name]!! ()
132131 })
133- rebuild()
132+ KanbanBro .event.addEventListener( " pluginLoaded " , { MainScope ().promise { rebuild() } } )
134133
135134 }
136135}
Original file line number Diff line number Diff line change 562562 let currentUpdateAbortController = null ;
563563
564564 function scheduleUpdate ( ) {
565- if ( currentUpdateAbortController ) {
566- try {
567- currentUpdateAbortController . abort ( ) ;
568- currentUpdateAbortController = null ;
569- } catch {
565+ console . log ( "[scheduleUpdate] Scheduling update" ) ;
570566
571- }
567+ if ( currentUpdateAbortController ) {
568+ currentUpdateAbortController . abort ( ) ;
569+ currentUpdateAbortController = null ;
572570 }
573571 const abortController = new AbortController ( ) ;
574572 currentUpdateAbortController = abortController ;
You can’t perform that action at this time.
0 commit comments