fix: admin/shared: memory leak

Massimo Melina committed Apr 15, 2026 at 12:05 UTC 59fe01d95b80fe7e4d80c663d92cd8df56b1ddfc
2 files changed +6 -4
admin/src/DataTable.ts
+1 -1
@@ -64,7 +64,7 @@ export function DataTable({ columns, initialState={}, actions, actionsProps, ini
64 return {
65 ...col,
66 originalRenderCell: col.renderCell || true,
67 - renderCell(params: any) {
67 + renderCell(params: GridRenderCellParams) {
68 const { columns } = params.api.store.getSnapshot()
69 return h(Box, { maxHeight: '100%', ...col.cellInnerProps, sx: { textWrap: 'wrap', ...callable(sx as any, params) } }, // wrap if necessary, but stay within the row
70 col.renderCell ? col.renderCell(params) : params.formattedValue,
admin/src/VfsTree.ts
+5 -3
@@ -9,7 +9,7 @@ import {
9 } from '@mui/icons-material'
10 import { Box, Typography } from '@mui/material'
11 import { id2vfsNode, isDescendantUri, reindexVfs, VfsNodeAdmin } from './VfsPage'
12 -import { onlyTruthy, pathEncode, prefix, toMutable, wantArray, Who, with_ } from './misc'
12 +import { getOrSet, onlyTruthy, pathEncode, prefix, toMutable, wantArray, Who, with_ } from './misc'
13 import { Flex, iconTooltip, useToggleButton } from './mui'
14 import VfsMenuBar from './VfsMenuBar'
15 import { ApiObject } from './api'
@@ -33,8 +33,10 @@ export default function VfsTree({ statusApi }:{ statusApi: ApiObject }) {
33 if (isRoot && ref.current)
34 ref.current.firstElementChild?.classList.toggle('Mui-selected', !(selectedFiles.length && !_.find(selectedFiles, { id: '/' })))
35 return h(TreeItem, {
36 - ref(el) { // workaround to permit drag&drop with mui5's tree
37 - el?.addEventListener('focusin', (e: any) => e.stopImmediatePropagation())
36 + ref(el) {
37 + if (el)
38 + getOrSet(el.dataset, 'hfsFocus', () => // workaround to permit drag&drop with mui5's tree
39 + void el.addEventListener('focusin', (e: any) => e.stopImmediatePropagation()))
40 ref.current = el
41 },
42 onDoubleClick: toggle,