From 13ae2d4766226042a27bae9891b26afe732b4d6a Mon Sep 17 00:00:00 2001 From: Eason Wang Date: Tue, 18 Aug 2020 10:45:35 +0800 Subject: [PATCH] code review --- src/component/toolbox/feature/DataView.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/component/toolbox/feature/DataView.ts b/src/component/toolbox/feature/DataView.ts index 0ee24d2e4d..2d10691baf 100644 --- a/src/component/toolbox/feature/DataView.ts +++ b/src/component/toolbox/feature/DataView.ts @@ -371,9 +371,11 @@ class DataView extends ToolboxFeature { addEventListener(closeButton, 'click', close); addEventListener(refreshButton, 'click', function () { - if ((typeof contentToOption === 'undefined' && typeof optionToContent !== 'undefined') || - (typeof contentToOption !== 'undefined' && typeof optionToContent === 'undefined')) { - console.warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.') + if ((contentToOption == null && optionToContent != null) || + (contentToOption != null && optionToContent == null)) { + if (__DEV__) { + console.warn('It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored.') + } close(); return; }