@@ -59,7 +59,7 @@ const props = withDefaults(
5959
6060const { locale } = useI18n ()
6161const { accentColors, selectedAccentColor } = useAccentColor ()
62- const { settings } = useSettings ()
62+ const { localSettings } = useUserLocalSettings ()
6363const { copy, copied } = useClipboard ()
6464
6565const colorMode = useColorMode ()
@@ -977,7 +977,7 @@ const effectiveDataSingle = computed<EvolutionData>(() => {
977977
978978 if (isDownloadsMetric .value && data .length ) {
979979 const pkg = effectivePackageNames .value [0 ] ?? props .packageName ?? ' '
980- if (settings .value .chartFilter .anomaliesFixed ) {
980+ if (localSettings .value .chartFilter .anomaliesFixed ) {
981981 data = applyBlocklistCorrection ({
982982 data ,
983983 packageName: pkg ,
@@ -1025,7 +1025,7 @@ const chartData = computed<{
10251025 for (const pkg of names ) {
10261026 let data = state .evolutionsByPackage [pkg ] ?? []
10271027 if (isDownloadsMetric .value && data .length ) {
1028- if (settings .value .chartFilter .anomaliesFixed ) {
1028+ if (localSettings .value .chartFilter .anomaliesFixed ) {
10291029 data = applyBlocklistCorrection ({ data , packageName: pkg , granularity })
10301030 }
10311031 }
@@ -1079,9 +1079,10 @@ const normalisedDataset = computed(() => {
10791079 const series = applyDataPipeline (
10801080 d .series .map (v => v ?? 0 ),
10811081 {
1082- averageWindow: settings .value .chartFilter .averageWindow ,
1083- smoothingTau: settings .value .chartFilter .smoothingTau ,
1084- predictionPoints: settings .value .chartFilter .predictionPoints ?? DEFAULT_PREDICTION_POINTS ,
1082+ averageWindow: localSettings .value .chartFilter .averageWindow ,
1083+ smoothingTau: localSettings .value .chartFilter .smoothingTau ,
1084+ predictionPoints:
1085+ localSettings .value .chartFilter .predictionPoints ?? DEFAULT_PREDICTION_POINTS ,
10851086 },
10861087 { granularity , lastDateMs , referenceMs , isAbsoluteMetric },
10871088 )
@@ -1678,10 +1679,10 @@ watch(selectedMetric, value => {
16781679 <label class =" flex flex-col gap-1 flex-1" >
16791680 <span class =" text-2xs font-mono text-fg-subtle tracking-wide uppercase" >
16801681 {{ $t('package.trends.average_window') }}
1681- <span class =" text-fg-muted" >({{ settings .chartFilter.averageWindow }})</span >
1682+ <span class =" text-fg-muted" >({{ localSettings .chartFilter.averageWindow }})</span >
16821683 </span >
16831684 <input
1684- v-model.number =" settings .chartFilter.averageWindow"
1685+ v-model.number =" localSettings .chartFilter.averageWindow"
16851686 type =" range"
16861687 min =" 0"
16871688 max =" 20"
@@ -1692,10 +1693,10 @@ watch(selectedMetric, value => {
16921693 <label class =" flex flex-col gap-1 flex-1" >
16931694 <span class =" text-2xs font-mono text-fg-subtle tracking-wide uppercase" >
16941695 {{ $t('package.trends.smoothing') }}
1695- <span class =" text-fg-muted" >({{ settings .chartFilter.smoothingTau }})</span >
1696+ <span class =" text-fg-muted" >({{ localSettings .chartFilter.smoothingTau }})</span >
16961697 </span >
16971698 <input
1698- v-model.number =" settings .chartFilter.smoothingTau"
1699+ v-model.number =" localSettings .chartFilter.smoothingTau"
16991700 type =" range"
17001701 min =" 0"
17011702 max =" 20"
@@ -1706,10 +1707,10 @@ watch(selectedMetric, value => {
17061707 <label class =" flex flex-col gap-1 flex-1" >
17071708 <span class =" text-2xs font-mono text-fg-subtle tracking-wide uppercase" >
17081709 {{ $t('package.trends.prediction') }}
1709- <span class =" text-fg-muted" >({{ settings .chartFilter.predictionPoints }})</span >
1710+ <span class =" text-fg-muted" >({{ localSettings .chartFilter.predictionPoints }})</span >
17101711 </span >
17111712 <input
1712- v-model.number =" settings .chartFilter.predictionPoints"
1713+ v-model.number =" localSettings .chartFilter.predictionPoints"
17131714 type =" range"
17141715 min =" 0"
17151716 max =" 30"
@@ -1774,9 +1775,11 @@ watch(selectedMetric, value => {
17741775 :class =" { 'opacity-50 pointer-events-none': !hasAnomalies }"
17751776 >
17761777 <input
1777- :checked =" settings .chartFilter.anomaliesFixed && hasAnomalies"
1778+ :checked =" localSettings .chartFilter.anomaliesFixed && hasAnomalies"
17781779 @change ="
1779- settings.chartFilter.anomaliesFixed = ($event.target as HTMLInputElement).checked
1780+ localSettings.chartFilter.anomaliesFixed = (
1781+ $event.target as HTMLInputElement
1782+ ).checked
17801783 "
17811784 type =" checkbox"
17821785 :disabled =" !hasAnomalies"
0 commit comments