Skip to content

Commit

Permalink
Reset my-jetpack from trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
manzoorwanijk committed Jul 22, 2024
1 parent 2c677a3 commit bb90514
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

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

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useConnection } from '@automattic/jetpack-connection';
import { getSiteData } from '@automattic/jetpack-initial-state';
import {
getMyJetpackWindowInitialState,
getMyJetpackWindowRestState,
getMyJetpackWindowConnectionState,
} from '../../data/utils/get-my-jetpack-window-state';
/**
Expand All @@ -24,18 +24,17 @@ interface MyJetpackConnection {
}

const useMyJetpackConnection = (): MyJetpackConnection => {
const { rest_root, rest_nonce } = getSiteData();

const { apiRoot, apiNonce } = getMyJetpackWindowRestState();
const { topJetpackMenuItemUrl, blogID } = getMyJetpackWindowInitialState();
const connectionData = useConnection( { apiRoot: rest_root, apiNonce: rest_nonce } );
const connectionData = useConnection( { apiRoot, apiNonce } );
const { registrationNonce } = getMyJetpackWindowConnectionState();

// Alias: https://github.com/Automattic/jetpack/blob/trunk/projects/packages/connection/src/class-rest-connector.php/#L315
const isSiteConnected = connectionData.isRegistered;

return {
apiNonce: rest_nonce,
apiRoot: rest_root,
apiNonce,
apiRoot,
blogID,
registrationNonce,
...connectionData,
Expand Down
1 change: 0 additions & 1 deletion projects/packages/my-jetpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"@automattic/jetpack-boost-score-api": "workspace:*",
"@automattic/jetpack-components": "workspace:*",
"@automattic/jetpack-connection": "workspace:*",
"@automattic/jetpack-initial-state": "workspace:*",
"@automattic/jetpack-licensing": "workspace:*",
"@tanstack/react-query": "5.20.5",
"@wordpress/api-fetch": "7.2.0",
Expand Down

0 comments on commit bb90514

Please sign in to comment.