Directly patch posterminalIds in Redux instead of reloading the category tree

After toggling a POS category, update the category's posterminalIds array
in-place rather than re-fetching the entire tree. This keeps the settings
cycle open on the same terminal. Also fix off-by-one in terminal cycling
and ensure posterminals load on category page mount.
This commit is contained in:
seb
2026-08-03 07:22:08 +02:00
parent f302eb9e67
commit 4bbe9caf55
4 changed files with 33 additions and 4 deletions

View File

@@ -283,7 +283,7 @@ export class CategoryEditTile extends Component {
const terminalCount = terminals?.length || 0;
this.setState((prev) => {
const next = prev.settingsTab + 1;
const nextTab = next > terminalCount ? -1 : next;
const nextTab = next >= terminalCount ? -1 : next;
console.log('[CategoryEditTile] settings toggle', {
terminals: terminals?.length,
terminalCount,