File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
src/BootstrapBlazor/wwwroot/modules Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,20 @@ export function init(id, options) {
1111 } ) ;
1212 }
1313
14+ const resetState = ( ) => {
15+ const { downlink, effectiveType, rtt } = navigator . connection ;
16+ invoke . invokeMethodAsync ( onNetworkStateChangedCallback , {
17+ downlink, networkType : effectiveType , rTT : rtt
18+ } ) ;
19+ }
20+
1421 const onlineStateChanged = ( ) => {
1522 if ( Array . isArray ( indicators ) ) {
1623 indicators . forEach ( indicator => {
1724 const el = document . getElementById ( indicator ) ;
1825 if ( el ) {
1926 el . classList . remove ( 'offline' ) ;
27+ resetState ( ) ;
2028 }
2129 } ) ;
2230 }
@@ -40,11 +48,7 @@ export function init(id, options) {
4048 onlineStateChanged,
4149 offlineStateChanged
4250 } ) ;
43-
44- const { downlink, effectiveType, rtt } = navigator . connection ;
45- invoke . invokeMethodAsync ( onNetworkStateChangedCallback , {
46- downlink, networkType : effectiveType , rTT : rtt
47- } ) ;
51+ resetState ( ) ;
4852}
4953
5054export async function dispose ( id ) {
You can’t perform that action at this time.
0 commit comments