fix(admin-bulk-actions): plug stale-closure bug in columns useMemo

Header checkbox for 'select all subscriptions' read allVisibleSubscriptionIds,
subscriptionSelection, isMultiTariff, toggleAllSubscriptions from a stale
closure because those values were declared AFTER the columns useMemo. The
warned-about deps were absent, so the header only refreshed by accident
when expandedRows or getFilteredSubs changed.

Relocate filteredUsers / allVisibleSubscriptionIds / toggleAllSubscriptions
above the columns block, list them as deps. Header now reflects current
selection without piggybacking on unrelated re-renders.

Same commit clears the matching AdminInfoPageEditor warning with an
explicit eslint-disable-line comment — the activeLocale omission was
already intentional (initial-content lock), just not silenced.
This commit is contained in:
c0mrade
2026-05-26 13:41:22 +03:00
parent 7426e1e6d1
commit 7817243253
2 changed files with 75 additions and 65 deletions

View File

@@ -981,7 +981,10 @@ export default function AdminInfoPageEditor() {
const initialContent = pageData.content[activeLocale] ?? pageData.content['ru'] ?? '';
editor.commands.setContent(initialContent);
editorPopulated.current = true;
}, [pageData, editor]); // activeLocale intentionally omitted
// activeLocale intentionally omitted — initial content is locked at editor
// mount; subsequent locale changes are routed through switchLocale().
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [pageData, editor]);
// Auto-generate slug from Russian title
useEffect(() => {