mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-21 01:05:30 +00:00
fixed removal logic of epg store
This commit is contained in:
parent
de5063d20b
commit
323cc7b52c
2 changed files with 9 additions and 5 deletions
|
|
@ -24,6 +24,7 @@ const EPGsTable = () => {
|
|||
const [rowSelection, setRowSelection] = useState([]);
|
||||
|
||||
const { epgs } = useEPGsStore();
|
||||
console.log(epgs);
|
||||
|
||||
const theme = useMantineTheme();
|
||||
|
||||
|
|
|
|||
|
|
@ -49,11 +49,14 @@ const useEPGsStore = create((set) => ({
|
|||
})),
|
||||
|
||||
removeEPGs: (epgIds) =>
|
||||
set((state) => ({
|
||||
epgs: Object.fromEntries(
|
||||
Object.entries(state.epgs).filter(([id]) => !epgIds.includes(id))
|
||||
),
|
||||
})),
|
||||
set((state) => {
|
||||
const updatedEPGs = { ...state.epgs };
|
||||
for (const id of epgIds) {
|
||||
delete updatedEPGs[id];
|
||||
}
|
||||
|
||||
return { epgs: updatedEPGs };
|
||||
}),
|
||||
}));
|
||||
|
||||
export default useEPGsStore;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue