Skip to content

Commit

Permalink
- use isDedicatedPage instead of screenId to pass up to the localized…
Browse files Browse the repository at this point in the history
… json
  • Loading branch information
jasonbahl committed Feb 28, 2024
1 parent fe08787 commit 0d8e7df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {useDispatch, useSelect} from "@wordpress/data";
import { EditorDrawer } from './components/EditorDrawer';
import { Editor } from './components/Editor';
import { parse, print } from 'graphql'
const { screenId } = window.WPGRAPHQL_IDE_DATA;
const { isDedicatedIdePage } = window.WPGRAPHQL_IDE_DATA;

const url = new URL(window.location.href);
const params = url.searchParams;
Expand All @@ -18,7 +18,7 @@ const setInitialState = () => {
setInitialStateLoaded
} = useDispatch('wpgraphql-ide');

if ( 'graphql_page_graphql-ide' === screenId ) {
if ( isDedicatedIdePage ) {
setShouldRenderStandalone(true)
}

Expand Down
2 changes: 1 addition & 1 deletion wpgraphql-ide.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function enqueue_react_app_with_styles(): void {
'graphqlEndpoint' => trailingslashit( site_url() ) . 'index.php?' . \WPGraphQL\Router::$route,
'rootElementId' => WPGRAPHQL_IDE_ROOT_ELEMENT_ID,
'context' => $app_context,
'screenId' => function_exists( 'get_current_screen' ) ? get_current_screen()->id : null,
'isDedicatedIdePage' => is_dedicated_ide_page(),
]
);

Expand Down

0 comments on commit 0d8e7df

Please sign in to comment.