Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Framework: Add sync-handler wrapper" #3229

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions client/lib/menu-data/menu-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -894,8 +894,7 @@ MenuData.prototype.fetchDefaultMenu = function() {
*/
MenuData.prototype.setDefaultMenu = function( pages ) {
var items = [],
site = sites.getSelectedSite(),
isDefaultMenuSet = !! this.data.defaultMenu;
site = sites.getSelectedSite();

pages.forEach( function( page ) {
var item = {
Expand All @@ -921,9 +920,8 @@ MenuData.prototype.setDefaultMenu = function( pages ) {
items: items,
locations: [ this.getPrimaryLocation() ]
} );
if ( ! isDefaultMenuSet ) {
this.data.menus.unshift( this.data.defaultMenu );
}

this.data.menus.unshift( this.data.defaultMenu );
this.emit( 'change' );
};

Expand Down
1 change: 0 additions & 1 deletion client/lib/posts/post-list-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ export default function( id ) {
postIds = difference( postIds, _activeList.postIds );
if ( postIds.length ) {
_activeList.postIds = _activeList.postIds.concat( postIds );
sort();
_activeList.page++;
}
}
Expand Down
12 changes: 3 additions & 9 deletions client/lib/wp/browser.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External dependencies
*/
import { SyncHandler } from './sync-handler';
import debugFactory from 'debug';
const debug = debugFactory( 'calypso:wp' );

Expand All @@ -12,20 +11,15 @@ import wpcomUndocumented from 'lib/wpcom-undocumented';
import config from 'config';
import wpcomSupport from 'lib/wp/support';

const addSyncHandlerWrapper = config.isEnabled( 'sync-handler' );
let wpcom;

if ( config.isEnabled( 'oauth' ) ) {
const oauthToken = require( 'lib/oauth-token' );
const requestHandler = addSyncHandlerWrapper
? new SyncHandler( require( 'lib/wpcom-xhr-wrapper' ) )
: require( 'lib/wpcom-xhr-wrapper' );
const oauthToken = require( 'lib/oauth-token' ),
requestHandler = require( 'lib/wpcom-xhr-wrapper' );

wpcom = wpcomUndocumented( oauthToken.getToken(), requestHandler );
} else {
const requestHandler = addSyncHandlerWrapper
? new SyncHandler( require( 'wpcom-proxy-request' ) )
: require( 'wpcom-proxy-request' );
const requestHandler = require( 'wpcom-proxy-request' );

wpcom = wpcomUndocumented( requestHandler );

Expand Down
21 changes: 0 additions & 21 deletions client/lib/wp/sync-handler/README.md

This file was deleted.

11 changes: 0 additions & 11 deletions client/lib/wp/sync-handler/defaults.js

This file was deleted.

197 changes: 0 additions & 197 deletions client/lib/wp/sync-handler/index.js

This file was deleted.

30 changes: 0 additions & 30 deletions client/lib/wp/sync-handler/whitelist-handler.js

This file was deleted.

3 changes: 1 addition & 2 deletions config/client.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@
"siftscience_key",
"facebook_api_key",
"discover_blog_id",
"support-user",
"sync-handler-defaults"
"support-user"
]
12 changes: 1 addition & 11 deletions config/development.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,8 @@
"perfmon": false,
"mailing-lists/unsubscribe": true,

"jetpack/calypso-first-signup-flow": true,
"sync-handler": true
"jetpack/calypso-first-signup-flow": true
},

"sync-handler-defaults": {
"name": "Calypso sync-handler",
"version": 1.0,
"driver": "INDEXEDDB",
"storeName": "calypso_sync_handler",
"description": "Request-handler wrapper used to catch REST-API responses"
},

"muse_supported_themes": [
"pub/twentytwelve",
"pub/twentythirteen",
Expand Down
3 changes: 0 additions & 3 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"inherits": "2.0.1",
"jade": "pugjs/jade#29784fd",
"jed": "1.0.2",
"jshashes": "1.0.5",
"json-loader": "0.5.4",
"jstimezonedetect": "1.0.5",
"key-mirror": "1.0.1",
Expand Down