From d2dcf27b99a3a4569a6d2dd83fa227cc2b04c8c4 Mon Sep 17 00:00:00 2001 From: Lu Ken Date: Wed, 1 Jan 2025 21:34:49 +0800 Subject: [PATCH] enable auto refresh for latest price Signed-off-by: Lu Ken --- .../src/renderer/src/components/TradingMain.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/GenTradeAgent/src/renderer/src/components/TradingMain.vue b/src/GenTradeAgent/src/renderer/src/components/TradingMain.vue index ea09637..9cf3b55 100644 --- a/src/GenTradeAgent/src/renderer/src/components/TradingMain.vue +++ b/src/GenTradeAgent/src/renderer/src/components/TradingMain.vue @@ -66,6 +66,10 @@ const optionsAsset = ref([]) const currentAsset = ref(store.state.currentAsset) const currentInterval = ref('1h') const optionsInterval = ref([ + { + label: '1m', + value: '1m' + }, { label: '1h', value: '1h' @@ -96,6 +100,12 @@ store.watch( } ) +const handlerRefresh = () => { + store.commit('updateCurrentAsset', currentAsset.value) + setTimeout(handlerRefresh, 30000) +} +handlerRefresh() + const handleUpdateCurrentAsset = (value: string) => { console.log('handleUpdateCurrentAsset:' + value) store.commit('updateCurrentAsset', value)