From 5e9e60285d72f2d3ac4c7493392aadb6a03e60ce Mon Sep 17 00:00:00 2001 From: Ben Wolski <570819+benwolski@users.noreply.github.com> Date: Wed, 15 Jan 2025 14:00:19 -0500 Subject: [PATCH] increase timeout for chart display to 60 minutes --- src/contexts/AppStateContext.tsx | 16 ++++++++-------- .../Chart/Draw/Toolbar/Toolbar.tsx | 4 ++-- .../Trade/TradeCharts/TradeCandleStickChart.tsx | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/contexts/AppStateContext.tsx b/src/contexts/AppStateContext.tsx index 7e4e6631c0..2fdbb3670b 100644 --- a/src/contexts/AppStateContext.tsx +++ b/src/contexts/AppStateContext.tsx @@ -44,7 +44,7 @@ export interface AppStateContextIF { close: () => void; }; isUserIdle: boolean; - isUserIdle40min: boolean; + isUserIdle60min: boolean; activeNetwork: NetworkIF; chooseNetwork: (network: NetworkIF) => void; layout: { @@ -65,7 +65,7 @@ export const AppStateContextProvider = (props: { const [isChatEnabled, setIsChatEnabled] = useState(CHAT_ENABLED); const [isUserOnline, setIsUserOnline] = useState(navigator.onLine); const [isUserIdle, setIsUserIdle] = useState(false); - const [isUserIdle40min, setIsUserIdle40min] = useState(false); + const [isUserIdle60min, setIsUserIdle60min] = useState(false); // layout--------------- @@ -141,13 +141,13 @@ export const AppStateContextProvider = (props: { setIsUserIdle(true); }; - const onIdle40 = () => { - setIsUserIdle40min(true); + const onIdle60min = () => { + setIsUserIdle60min(true); }; const onActive = () => { setIsUserIdle(false); - setIsUserIdle40min(false); + setIsUserIdle60min(false); }; // Custom visibility change handler to trigger onActive when the tab becomes visible @@ -203,9 +203,9 @@ export const AppStateContextProvider = (props: { }); useIdleTimer({ - onIdle: onIdle40, + onIdle: onIdle60min, onActive, - timeout: 1000 * 60 * 40, // set user to idle after 40 minutes + timeout: 1000 * 60 * 60, // set user to idle after 60 minutes promptTimeout: 0, events: [ 'mousemove', @@ -278,7 +278,7 @@ export const AppStateContextProvider = (props: { server: { isEnabled: isServerEnabled }, isUserOnline, isUserIdle, - isUserIdle40min, + isUserIdle60min, subscriptions: { isEnabled: areSubscriptionsEnabled }, walletModal: { isOpen: isGateWalletModalOpen, diff --git a/src/pages/platformAmbient/Chart/Draw/Toolbar/Toolbar.tsx b/src/pages/platformAmbient/Chart/Draw/Toolbar/Toolbar.tsx index 7973f8931d..f9374be1f1 100644 --- a/src/pages/platformAmbient/Chart/Draw/Toolbar/Toolbar.tsx +++ b/src/pages/platformAmbient/Chart/Draw/Toolbar/Toolbar.tsx @@ -88,7 +88,7 @@ function ChartToolbar() { const [isHoveredUp, setIsHoveredUp] = useState(false); const [isHoveredDown, setIsHoveredDown] = useState(false); - const { isUserIdle40min } = useContext(AppStateContext); + const { isUserIdle60min } = useContext(AppStateContext); const [hoveredTool, setHoveredTool] = useState( undefined, @@ -321,7 +321,7 @@ function ChartToolbar() { return chartContainerOptions && chartContainerOptions.top !== 0 && - !isUserIdle40min ? ( + !isUserIdle60min ? ( )} - {isOpenChart && !isUserIdle40min && ( + {isOpenChart && !isUserIdle60min && ( <>