From 009a23f32ea20064928322318faf7b8bc0f68e06 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 8 Aug 2020 15:22:52 +0200 Subject: [PATCH] Improve multiplot saving --- src/components/ftbot/CandleChart.vue | 4 ++-- src/components/ftbot/PlotConfigurator.vue | 1 - src/shared/storage.ts | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/ftbot/CandleChart.vue b/src/components/ftbot/CandleChart.vue index 9d4d4610..618cd96b 100644 --- a/src/components/ftbot/CandleChart.vue +++ b/src/components/ftbot/CandleChart.vue @@ -34,7 +34,7 @@ import randomColor from '@/shared/randomColor'; import { roundTimeframe } from '@/shared/timemath'; import { timestampms } from '@/shared/formatters'; import PlotConfigurator from '@/components/ftbot/PlotConfigurator.vue'; -import { loadCustomPlotConfig } from '@/shared/storage'; +import { loadCustomPlotConfig, loadPlotConfigName } from '@/shared/storage'; import 'echarts'; @@ -70,7 +70,7 @@ export default class CandleChart extends Vue { sellData = [] as Array[]; mounted() { - this.plotConfig = loadCustomPlotConfig(); + this.plotConfig = loadCustomPlotConfig(loadPlotConfigName()); } showConfigurator() { diff --git a/src/components/ftbot/PlotConfigurator.vue b/src/components/ftbot/PlotConfigurator.vue index feb45b2b..5ec981de 100644 --- a/src/components/ftbot/PlotConfigurator.vue +++ b/src/components/ftbot/PlotConfigurator.vue @@ -229,7 +229,6 @@ export default class PlotConfigurator extends Vue { } mounted() { - console.log('mounted'); this.plotConfig = this.value; } diff --git a/src/shared/storage.ts b/src/shared/storage.ts index b6f84178..52dfb310 100644 --- a/src/shared/storage.ts +++ b/src/shared/storage.ts @@ -12,7 +12,7 @@ export function storePlotConfigName(plotConfigName: string): void { } export function loadAllCustomPlotConfig(): PlotConfig { - return JSON.parse(localStorage.getItem(PLOT_CONFIG) || JSON.stringify(EMPTY_PLOTCONFIG)); + return JSON.parse(localStorage.getItem(PLOT_CONFIG) || '{}'); } export function loadCustomPlotConfig(configName: string): PlotConfig {