chore(trading): make deal ticket open on market change (#4749)

This commit is contained in:
Art 2023-09-12 20:26:54 +02:00 committed by GitHub
parent 27e8ce88bf
commit ccbe34e172
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,15 +69,15 @@ export const MarketPage = () => {
useEffect(() => {
if (data?.id && data.id !== lastMarketId) {
update({ marketId: data.id });
}
}, [update, lastMarketId, data?.id]);
// Make sidebar open on deal ticket by default
useEffect(() => {
if (init && view === null) {
// make sidebar open on market id change
setView({ type: ViewType.Order });
}
}, [init, view, setView]);
// make sidebar open on deal ticket by default
if (view === null) {
setView({ type: ViewType.Order });
}
}, [update, lastMarketId, data?.id, setView, init, view]);
const tradeView = useMemo(() => {
if (largeScreen) {