From 17c08db4ec6b2e144f3b379d91fc1d0029c445d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20B=C3=BC=C3=9Femeyer?= Date: Thu, 28 Nov 2024 11:49:54 +0100 Subject: [PATCH] use TS nullish coalescing operator instead of if --- .../dashboard/dataset/dataset_settings_data_tab.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/javascripts/dashboard/dataset/dataset_settings_data_tab.tsx b/frontend/javascripts/dashboard/dataset/dataset_settings_data_tab.tsx index 84cefc0037..ab4d65a60f 100644 --- a/frontend/javascripts/dashboard/dataset/dataset_settings_data_tab.tsx +++ b/frontend/javascripts/dashboard/dataset/dataset_settings_data_tab.tsx @@ -52,9 +52,7 @@ export const syncDataSourceFields = ( // Copy from simple to advanced: update json const dataSourceFromSimpleTab = form.getFieldValue("dataSource"); if (syncDatasetName) { - if (dataSourceFromSimpleTab.id == null) { - dataSourceFromSimpleTab.id = {}; - } + dataSourceFromSimpleTab.id ??= {}; dataSourceFromSimpleTab.id.name = form.getFieldValue(["dataset", "name"]); } form.setFieldsValue({