Skip to content

Commit c840c39

Browse files
authored
fix issue with directory "oversearch" causing an error with pinned rows (#2134)
1 parent 5c6c610 commit c840c39

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

frontend/app/element/errorboundary.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export class ErrorBoundary extends React.Component<
1313
}
1414

1515
componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
16+
console.log("ErrorBoundary caught an error:", error, errorInfo);
1617
this.setState({ error: error });
1718
}
1819

frontend/app/view/preview/directorypreview.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -385,12 +385,20 @@ function DirectoryTable({
385385

386386
useLayoutEffect(() => {
387387
const rows = table.getRowModel()?.flatRows;
388+
let foundParentDir = false;
389+
388390
for (const row of rows) {
389391
if (row.getValue("name") == "..") {
390392
row.pin("top");
391-
return;
393+
foundParentDir = true;
394+
break;
392395
}
393396
}
397+
398+
// If we didn't find the ".." row, reset the pinning to avoid stale references
399+
if (!foundParentDir) {
400+
table.resetRowPinning();
401+
}
394402
}, [table, data]);
395403
const columnSizeVars = useMemo(() => {
396404
const headers = table.getFlatHeaders();

0 commit comments

Comments
 (0)