fix banner and chart color

This commit is contained in:
2026-06-24 11:52:09 +03:30
parent 6c89375370
commit d083469710
6 changed files with 31 additions and 15 deletions
+10 -2
View File
@@ -58,7 +58,7 @@
import { computed, nextTick, onMounted, ref, watch } from 'vue'
import { useConfigStore } from '@/store/configStore'
import { usePrice } from '@/utils/usePrice'
import { getProjectFontFamily, getProjectPrimaryColor } from '@/utils/config'
import { getBoursecuChartColor, getProjectFontFamily } from '@/utils/config'
import {
computeKatodMesVisualYBounds,
prepareKatodMesChartPoints,
@@ -101,6 +101,14 @@ const chartInnerClass = computed(() =>
const showMetalSelector = computed(() => props.layout === 'boursecu')
const chartColor = computed(() => {
if (props.layout === 'boursecu') {
return getBoursecuChartColor()
}
return config.config?.color ?? '#0A1B37'
})
const emit = defineEmits<{
updateData: [timeline: string]
'update:selectedMetal': [metal: ChartMetalType]
@@ -295,7 +303,7 @@ const chartOptions = computed(() => {
}),
style: { fontFamily },
},
colors: [getProjectPrimaryColor() ?? config.config?.color ?? '#2178b5'],
colors: [chartColor.value],
fill: {
type: 'gradient',
gradient: {
@@ -1,5 +1,6 @@
import { ref } from 'vue'
import { getConstByKey } from '@/api/const'
import { useSettingsStore } from '@/store/settingsStore'
function parseJsonArray(raw: unknown): unknown[] {
if (raw == null || raw === '') {
@@ -30,6 +31,13 @@ let bannersPromise: Promise<void> | null = null
let bannersLoaded = false
async function fetchBanners(force = false) {
const settingsStore = useSettingsStore()
if (!settingsStore.isSettingTruthy('banner_enabled')) {
banners.value = []
bannersLoaded = true
return
}
if (!force && bannersLoaded) {
return
}