From 4e982be6138e81d62f986c19b224db9e00600b85 Mon Sep 17 00:00:00 2001 From: Thomas Nordquist Date: Mon, 17 Jun 2019 18:19:26 +0200 Subject: [PATCH] Show notification when adding charts --- app/src/actions/Charts.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/actions/Charts.ts b/app/src/actions/Charts.ts index 9e11e49..960b981 100644 --- a/app/src/actions/Charts.ts +++ b/app/src/actions/Charts.ts @@ -2,7 +2,7 @@ import { Action, ActionTypes, ChartParameters } from '../reducers/Charts' import { AppState } from '../reducers' import { default as persistentStorage, StorageIdentifier } from '../utils/PersistentStorage' import { Dispatch } from 'redux' -import { showError } from './Global' +import { showError, showNotification } from './Global' interface ConnectionViewState { charts: Array @@ -72,6 +72,7 @@ export const addChart = (chartParameters: ChartParameters) => async ( .find(chart => chart.topic === chartParameters.topic && chart.dotPath === chartParameters.dotPath) ) if (chartExists) { + dispatch(showNotification('Already added')) return } @@ -80,6 +81,7 @@ export const addChart = (chartParameters: ChartParameters) => async ( chart: chartParameters, }) dispatch(saveCharts()) + dispatch(showNotification('Added to chart panel')) } export const updateChart = (chartParameters: ChartParameters) => async (