Skip to content

Commit

Permalink
Fix structure export bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ckitsanelis committed Jan 18, 2024
1 parent 276404f commit be0b516
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/viewer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,12 @@ export default class App extends React.Component<Props, State> {
}
}

exportData(exportIndices: number[]) {
exportData(exportIndices: number[], structureExport: boolean) {
var exportObjects: Object[] = []
const originalColumns = this.state.logFile.headers;
if (exportIndices.length === 0 || this.state.filterSearch === false)
exportIndices = Array.from(Array(this.state.logFile.amountOfRows()).keys())
if (!structureExport)
if (exportIndices.length === 0 || this.state.filterSearch === false)
exportIndices = Array.from(Array(this.state.logFile.amountOfRows()).keys())
for (var index of exportIndices) {
var rowObject = {};
const row = this.state.logFile.rows[index]
Expand Down Expand Up @@ -485,7 +486,7 @@ export default class App extends React.Component<Props, State> {
</VSCodeButton>
<VSCodeButton
style={{ marginLeft: "5px", height: "25px", width: "110px" }}
onClick={() => this.exportData(this.state.searchMatches)}
onClick={() => this.exportData(this.state.searchMatches, false)}
>
Export
</VSCodeButton>
Expand Down Expand Up @@ -769,7 +770,7 @@ export default class App extends React.Component<Props, State> {
onMatchStructure={(expression) => this.handleStructureMatching(expression)}
onDefineSegment={(collapsibleRows) => this.updateSegmentation(collapsibleRows)}
onNavigateStructureMatches={(isGoingForward) => this.handleNavigation(isGoingForward, true)}
onExportStructureMatches={() => this.exportData(this.state.structureMatches.flat(1))}
onExportStructureMatches={() => this.exportData(this.state.structureMatches.flat(1), true)}
/>
)}
</div>
Expand Down

0 comments on commit be0b516

Please sign in to comment.