Improve multiplot saving

This commit is contained in:
Matthias 2020-08-08 15:22:52 +02:00
parent 062769f764
commit 009a23f32e
3 changed files with 3 additions and 4 deletions

View File

@ -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<number>[];
mounted() {
this.plotConfig = loadCustomPlotConfig();
this.plotConfig = loadCustomPlotConfig(loadPlotConfigName());
}
showConfigurator() {

View File

@ -229,7 +229,6 @@ export default class PlotConfigurator extends Vue {
}
mounted() {
console.log('mounted');
this.plotConfig = this.value;
}

View File

@ -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 {