PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.16.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.16.0
2.16.0 2.15.0 2.14.0 2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 All 83 releases
← All changes | vendor/storeengine/wordpress-sdk/static/license-app.js +11 -4 2.13.1 → 2.16.0 View file →
@@ -21,9 +21,15 @@
21 21 const { __, sprintf } = ( wp.i18n || { __: ( s ) => s, sprintf: ( s ) => s } );
22 22
23 23 function api( config, path, opts ) {
24 24 opts = opts || {};
25 - const url = config.restUrl + path.replace( /^\//, '' );
25 + // On plain permalinks restUrl is `…/index.php?rest_route=/…/`, so a
26 + // path's own query string must be joined with `&`, not a second `?`.
27 + const parts = path.replace( /^\//, '' ).split( '?' );
28 + let url = config.restUrl + parts[ 0 ];
29 + if ( parts[ 1 ] ) {
30 + url += ( config.restUrl.indexOf( '?' ) === -1 ? '?' : '&' ) + parts[ 1 ];
31 + }
26 32
27 33 return fetch( url, {
28 34 method: opts.method || 'GET',
29 35 headers: {
@@ -684,12 +690,13 @@
684 690 const refreshStatus = useCallback( () => {
685 691 return api( config, 'updates/status' ).then( setState );
686 692 }, [ config ] );
687 693
688 - const refreshVersions = useCallback( () => {
694 + // `force` bypasses the server-side cache (Refresh button, after an install).
695 + const refreshVersions = useCallback( ( force ) => {
689 696 setVersionsLoading( true );
690 697 setVersionsError( null );
691 - return api( config, 'updates/versions' )
698 + return api( config, true === force ? 'updates/versions?force=true' : 'updates/versions' )
692 699 .then( ( res ) => setVersions( res && res.versions ? res.versions : [] ) )
693 700 .catch( ( err ) => {
694 701 setVersions( [] );
695 702 setVersionsError( { code: err.code, message: err.message } );
@@ -856,9 +863,9 @@
856 863 loading: versionsLoading,
857 864 installing,
858 865 onInstall: handleInstall,
859 866 current: state.current_version,
860 - onRefresh: refreshVersions,
867 + onRefresh: () => refreshVersions( true ),
861 868 refreshing: versionsLoading,
862 869 error: versionsError,
863 870 } ),
864 871