Skip to content

Commit 3dd7ead

Browse files
committed
Bug fix: fixed regression error with upload panel
1 parent c93ccac commit 3dd7ead

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/firefly/js/visualize/ui/FileUploadViewPanel.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ function getNextState() {
183183
// because this value is stored in different fields.. so we have to check on what options were selected to determine the active value
184184
const fieldState = getField(panelKey, getLoadingFieldName()) || {};
185185
const {analysisResult, message} = fieldState;
186+
let modelToUseForDetails= getTblById(SUMMARY_TBL_ID)?? currentSummaryModel;
186187

187188
if (message) {
188189
return {message, report:undefined, summaryModel:undefined, detailsModel:undefined};
@@ -207,6 +208,7 @@ function getNextState() {
207208
totalRows: data.length,
208209
tableData: {columns, data}
209210
};
211+
modelToUseForDetails= currentSummaryModel;
210212

211213
const firstExtWithData = parts.findIndex((p) => !p.type.includes('HeaderOnly'));
212214
if (firstExtWithData >= 0) {
@@ -217,7 +219,7 @@ function getNextState() {
217219

218220
}
219221
}
220-
let detailsModel = getDetailsModel( getTblById(SUMMARY_TBL_ID) ?? currentSummaryModel,currentReport);
222+
let detailsModel = getDetailsModel( modelToUseForDetails,currentReport);
221223
if (shallowequal(detailsModel, currentDetailsModel)) {
222224
detailsModel = currentDetailsModel;
223225
}
@@ -232,7 +234,7 @@ function getDetailsModel(tableModel, report) {
232234
const partNum = getCellValue(tableModel, highlightedRow, 'Index');
233235
const type = getCellValue(tableModel, highlightedRow, 'Type');
234236
if (type===UNKNOWN_FORMAT) return undefined;
235-
const details = report?.parts?.[partNum].details;
237+
const details = report?.parts?.[partNum]?.details;
236238
if (details) details.tbl_id = DETAILS_TBL_ID;
237239
return details;
238240
}

0 commit comments

Comments
 (0)