@@ -8,7 +8,6 @@ import { LastAction } from 'reactant-last-action';
88import { HandleClientOptions } from './interfaces' ;
99import { lastActionName , proxyServerActionName } from './constants' ;
1010import { PortDetector } from './portDetector' ;
11- import { Router } from './router' ;
1211import { applyMethod } from './applyMethod' ;
1312
1413export const handleClient = ( {
@@ -32,24 +31,6 @@ export const handleClient = ({
3231 if ( preloadedState ) {
3332 lastAction . sequence = preloadedState [ lastAction . stateKey ] . _sequence ;
3433 }
35- if ( ! portDetector . sharedAppOptions . forcedSyncClient ) {
36- const router : Router = container . get ( Router ) ;
37- const visibilitychange = async ( ) => {
38- if ( document . visibilityState === 'visible' ) {
39- portDetector . syncFullState ( { forceSync : false } ) ;
40- await portDetector . syncFullStatePromise ;
41- if ( router . toBeRouted ) {
42- const fn = router . toBeRouted ;
43- router . toBeRouted = null ;
44- fn ( ) ;
45- }
46- }
47- } ;
48- document . addEventListener ( 'visibilitychange' , visibilitychange ) ;
49- disposeListeners . push ( ( ) => {
50- document . removeEventListener ( 'visibilitychange' , visibilitychange ) ;
51- } ) ;
52- }
5334 disposeListeners . push (
5435 transport . listen ( lastActionName , async ( action ) => {
5536 if ( portDetector . disableSyncClient ) return ;
0 commit comments