mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-22 07:53:34 +01:00
fix: fixed codemirror performance issue
This commit is contained in:
parent
762599b82e
commit
8b48a388ad
@ -2,6 +2,7 @@ import React from 'react';
|
|||||||
import RequestTabs from 'components/RequestTabs';
|
import RequestTabs from 'components/RequestTabs';
|
||||||
import RequestTabPanel from 'components/RequestTabPanel';
|
import RequestTabPanel from 'components/RequestTabPanel';
|
||||||
import Sidebar from 'components/Sidebar';
|
import Sidebar from 'components/Sidebar';
|
||||||
|
import { useStore } from 'providers/Store';
|
||||||
import StyledWrapper from './StyledWrapper';
|
import StyledWrapper from './StyledWrapper';
|
||||||
|
|
||||||
const SERVER_RENDERED = typeof navigator === 'undefined' || global['PREVENT_CODEMIRROR_RENDER'] === true;
|
const SERVER_RENDERED = typeof navigator === 'undefined' || global['PREVENT_CODEMIRROR_RENDER'] === true;
|
||||||
@ -29,6 +30,11 @@ if(!SERVER_RENDERED) {
|
|||||||
|
|
||||||
|
|
||||||
export default function Main() {
|
export default function Main() {
|
||||||
|
const [store, storeDispatch] = useStore();
|
||||||
|
const {
|
||||||
|
activeRequestTabUid
|
||||||
|
} = store;
|
||||||
|
|
||||||
if (SERVER_RENDERED) {
|
if (SERVER_RENDERED) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -39,7 +45,7 @@ export default function Main() {
|
|||||||
<Sidebar />
|
<Sidebar />
|
||||||
<section className='flex flex-grow flex-col'>
|
<section className='flex flex-grow flex-col'>
|
||||||
<RequestTabs />
|
<RequestTabs />
|
||||||
<RequestTabPanel />
|
<RequestTabPanel key={activeRequestTabUid}/>
|
||||||
</section>
|
</section>
|
||||||
</StyledWrapper>
|
</StyledWrapper>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user