diff --git a/src/App.jsx b/src/App.jsx index 0ff72e1..c6fb089 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -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; @@ -18,7 +18,7 @@ const setInitialState = () => { setInitialStateLoaded } = useDispatch('wpgraphql-ide'); - if ( 'graphql_page_graphql-ide' === screenId ) { + if ( isDedicatedIdePage ) { setShouldRenderStandalone(true) } diff --git a/wpgraphql-ide.php b/wpgraphql-ide.php index 0821771..90d8fd2 100644 --- a/wpgraphql-ide.php +++ b/wpgraphql-ide.php @@ -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(), ] );