Skip to content

Commit a34b76c

Browse files
authored
fix columns conflict (#466)
1 parent e67dc95 commit a34b76c

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

web/src/components/modals/export-modal.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,17 @@ export const ExportModal: React.FC<ExportModalProps> = ({
124124
}, [isExportAll, selectedColumns]);
125125

126126
React.useEffect(() => {
127-
// reload selected columns when config is loaded
128-
setSelectedColumns(
129-
getLocalStorage(LOCAL_STORAGE_EXPORT_COLS_KEY, columns, {
130-
id: 'id',
131-
criteria: 'isSelected'
132-
})
133-
);
127+
// reload selected columns when config is loaded and popup closed
128+
if (!isModalOpen) {
129+
setSelectedColumns(
130+
getLocalStorage(LOCAL_STORAGE_EXPORT_COLS_KEY, _.cloneDeep(columns), {
131+
id: 'id',
132+
criteria: 'isSelected'
133+
})
134+
);
135+
}
134136
// eslint-disable-next-line react-hooks/exhaustive-deps
135-
}, [columns]);
137+
}, [isModalOpen, columns]);
136138

137139
return (
138140
<Modal

0 commit comments

Comments
 (0)