mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-01-23 10:45:27 +00:00
Refactor editChannel to use selectedTableIds directly from the table state and remove unused selection clearing effects.
This commit is contained in:
parent
01d4b25303
commit
374aa82e22
1 changed files with 1 additions and 13 deletions
|
|
@ -376,7 +376,7 @@ const ChannelsTable = ({ }) => {
|
|||
|
||||
const editChannel = async (ch = null) => {
|
||||
// Use table's selected state instead of store state to avoid stale selections
|
||||
const currentSelection = table ? table.getState().selectedTableIds : [];
|
||||
const currentSelection = table ? table.selectedTableIds : [];
|
||||
console.log('editChannel called with:', { ch, currentSelection, tableExists: !!table });
|
||||
|
||||
if (currentSelection.length > 1) {
|
||||
|
|
@ -634,18 +634,6 @@ const ChannelsTable = ({ }) => {
|
|||
setPaginationString(`${startItem} to ${endItem} of ${totalCount}`);
|
||||
}, [pagination.pageIndex, pagination.pageSize, totalCount]);
|
||||
|
||||
// Clear selection when data changes (e.g., when navigating back to the page)
|
||||
useEffect(() => {
|
||||
setSelectedChannelIds([]);
|
||||
}, [data, setSelectedChannelIds]);
|
||||
|
||||
// Clear selection when component unmounts
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
setSelectedChannelIds([]);
|
||||
};
|
||||
}, [setSelectedChannelIds]);
|
||||
|
||||
const columns = useMemo(
|
||||
() => [
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue