浏览代码

DataSourceSettings: Minor fix for uncontrolled input (#16863)

Torkel Ödegaard 6 年之前
父节点
当前提交
20dada0159
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      public/app/features/datasources/settings/DataSourceSettingsPage.tsx

+ 1 - 1
public/app/features/datasources/settings/DataSourceSettingsPage.tsx

@@ -171,7 +171,7 @@ export class DataSourceSettingsPage extends PureComponent<Props, State> {
   }
 
   get hasDataSource() {
-    return Object.keys(this.props.dataSource).length > 0;
+    return this.state.dataSource.id > 0;
   }
 
   render() {