From 15c111b39d66e9136c6d74a074b6e18bb58b5c4d Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 12 Mar 2019 21:30:48 -0700 Subject: [PATCH] better comments --- public/app/plugins/panel/text2/module.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/public/app/plugins/panel/text2/module.tsx b/public/app/plugins/panel/text2/module.tsx index ae94e16a766..f2cf52fbd75 100644 --- a/public/app/plugins/panel/text2/module.tsx +++ b/public/app/plugins/panel/text2/module.tsx @@ -6,16 +6,15 @@ import { TextOptions, defaults } from './types'; import { PanelModel } from 'app/features/dashboard/state'; import get from 'lodash/get'; +import cloneDeep from 'lodash/cloneDeep'; export const reactPanel = new ReactPanelPlugin(TextPanel); const validator = (model: PanelModel): TextOptions => { const options = model.options as TextOptions; if (!options) { - const old = get(model, 'cachedPluginOptions.text'); - if (old) { - return old; - } + // Use the same settings from an existing 'text' panel + return cloneDeep(get(model, 'cachedPluginOptions.text')); } return options; };