mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 10:27:49 +00:00
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:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user