Should be `if ( EXPECTED_STATE && sync.state !== Sync[EXPECTED_STATE] ) {`