Skip to content

Commit 0677285

Browse files
committed
front: fix MacroEditorState.getPathKeys() when missing secondary code
getPathKey() (right above) produces different keys when an OP is missing a secondary code: it omits the "/code" suffix. Do the same here so that positions don't get lost for these OPs. Signed-off-by: Simon Ser <[email protected]>
1 parent fbbeb88 commit 0677285

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

front/src/applications/operationalStudies/components/MacroEditor/MacroEditorState.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ export default class MacroEditorState {
224224
static getPathKeys(item: SearchResultItemOperationalPoint): string[] {
225225
const result = [];
226226
result.push(`op_id:${item.obj_id}`);
227-
result.push(`trigram:${item.trigram}/${item.ch}`);
228-
result.push(`uic:${item.uic}/${item.ch}`);
227+
result.push(`trigram:${item.trigram}${item.ch ? `/${item.ch}` : ''}`);
228+
result.push(`uic:${item.uic}${item.ch ? `/${item.ch}` : ''}`);
229229
item.track_sections.forEach((ts) => {
230230
result.push(`track_offset:${ts.track}+${ts.position}`);
231231
});

0 commit comments

Comments
 (0)