Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Eason Wang committed Aug 18, 2020
1 parent 1262da3 commit 13ae2d4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/component/toolbox/feature/DataView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,11 @@ class DataView extends ToolboxFeature<ToolboxDataViewFeatureOption> {
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;
}
Expand Down

0 comments on commit 13ae2d4

Please sign in to comment.