chore: TokenMarketValuesStore removed from shared/RootStore

This commit is contained in:
Michał Cieślak 2024-10-17 13:57:38 +02:00 committed by Michał
parent 5842600eb0
commit ee5fb50c29
4 changed files with 20 additions and 16 deletions

View File

@ -36,11 +36,19 @@ Item {
property var networkFilters
onNetworkFiltersChanged: d.forceRefreshBalanceStore = true
/*required*/ property string address: ""
property SharedStores.TokenBalanceHistoryStore balanceStore: SharedStores.TokenBalanceHistoryStore {}
SharedStores.TokenBalanceHistoryStore {
id: balanceStore
}
SharedStores.TokenMarketValuesStore {
id: marketValueStore
}
QtObject {
id: d
property SharedStores.TokenMarketValuesStore marketValueStore : root.sharedRootStore.marketValueStore
readonly property string symbol: !!root.token? root.token.symbol?? "" : ""
property bool marketDetailsLoading: !!root.token? root.token.marketDetailsLoading?? false : false
property bool tokenDetailsLoading: !!root.token? root.token.detailsLoading?? false: false
@ -67,7 +75,7 @@ Item {
if(response.historicalData === null || response.historicalData <= 0)
return
d.marketValueStore.setTimeAndValueData(response.historicalData, response.range)
marketValueStore.setTimeAndValueData(response.historicalData, response.range)
}
}
@ -138,7 +146,7 @@ Item {
id: graphDetail
property int selectedGraphType: AssetsDetailView.GraphType.Price
property SharedStores.TokenMarketValuesStore selectedStore: d.marketValueStore
property SharedStores.TokenMarketValuesStore selectedStore: marketValueStore
function dataReady() {
return typeof selectedStore != "undefined"
@ -179,7 +187,7 @@ Item {
}
if(!isTimeRange) {
graphDetail.selectedStore = graphDetail.selectedGraphType === AssetsDetailView.GraphType.Price ? d.marketValueStore : balanceStore
graphDetail.selectedStore = graphDetail.selectedGraphType === AssetsDetailView.GraphType.Price ? marketValueStore : balanceStore
}
chart.refresh()

View File

@ -1,8 +1,8 @@
import QtQuick 2.13
import QtQml 2.15
import utils 1.0
Item {
QtObject {
id: root
// @see src/app_service/service/token/async_tasks.nim BalanceHistoryTimeInterval
@ -78,7 +78,7 @@ Item {
return d.timeRangeStrToEnumMap.get(str)
}
QtObject {
readonly property QtObject _d: QtObject {
id: d
readonly property int hoursInADay: 24
@ -101,4 +101,4 @@ Item {
}
}
}
}
}

View File

@ -18,8 +18,6 @@ QtObject {
required property CurrenciesStore currencyStore
property TokenMarketValuesStore marketValueStore: TokenMarketValuesStore {}
function setNeverAskAboutUnfurlingAgain(value) {
localAccountSensitiveSettings.neverAskAboutUnfurlingAgain = value;
}

View File

@ -1,6 +1,4 @@
import QtQuick 2.13
import StatusQ.Core 0.1
import QtQml 2.15
import utils 1.0
@ -11,7 +9,7 @@ ChartStoreBase {
readonly property alias tokenSymbol: d.tokenSymbol
readonly property alias currencySymbol: d.currencySymbol
QtObject {
readonly property QtObject _d: QtObject {
id: d
// Data identity received from backend
@ -67,7 +65,7 @@ ChartStoreBase {
}
}
Connections {
readonly property Connections _c: Connections {
target: walletSectionAllTokens
function onTokenBalanceHistoryDataReady(balanceHistoryJson: string) {