Skip to content

Commit 736664a

Browse files
committed
Use original button IDs, cast to string
1 parent c8ffc73 commit 736664a

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/processors/obfProcessor.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,7 @@ class ObfProcessor extends BaseProcessor {
259259
}
260260

261261
return new AACButton({
262-
// Make button ID unique by combining page ID and button ID
263-
id: `${pageId}::${btn?.id || ''}`,
262+
id: String(btn.id),
264263
label: String(btn?.label || ''),
265264
message: String(btn?.vocalization || btn?.label || ''),
266265
visibility: mapObfVisibility(btn.hidden),
@@ -319,7 +318,7 @@ class ObfProcessor extends BaseProcessor {
319318
orderRow.forEach((cellId, colIndex) => {
320319
if (cellId === null || cellId === undefined) return;
321320
if (rowIndex >= rows || colIndex >= cols) return;
322-
const aacBtn = buttonMap.get(`${pageId}::${cellId}`);
321+
const aacBtn = buttonMap.get(String(cellId));
323322
if (aacBtn) {
324323
grid[rowIndex][colIndex] = aacBtn;
325324
}
@@ -331,7 +330,7 @@ class ObfProcessor extends BaseProcessor {
331330
const row = Math.floor(btn.box_id / cols);
332331
const col = btn.box_id % cols;
333332
if (row < rows && col < cols) {
334-
const aacBtn = buttonMap.get(`${pageId}::${btn.id}`);
333+
const aacBtn = buttonMap.get(String(btn.id));
335334
if (aacBtn) {
336335
grid[row][col] = aacBtn;
337336
}

0 commit comments

Comments
 (0)