Skip to content

Commit

Permalink
FIX locationIds became array after refactorign
Browse files Browse the repository at this point in the history
  • Loading branch information
driver-deploy-2 committed Sep 17, 2024
1 parent 8ff4775 commit dce3630
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions packages/gui/src/services/meiosis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,19 +149,21 @@ export const setSearchResults: Service<State> = {
if (actIdx < 0) return;
const act = acts[actIdx];
[act.preparation, act.preactivity, act.activity, act.postactivity].forEach((phase, phaseIdx) => {
if (phase.locationIds) {
const include = matchingLoc.get(phase.locationIds);
if (include) {
searchResults.push({
crimeScriptIdx: crimeScriptIdx,
actIdx,
phaseIdx,
activityIdx: -1,
conditionIdx: -1,
type: 'cast',
resultMd: highlighter(include.label),
});
}
if (phase.locationIds && Array.isArray(phase.locationIds)) {
phase.locationIds.forEach((id) => {
const include = matchingLoc.get(id);
if (include) {
searchResults.push({
crimeScriptIdx: crimeScriptIdx,
actIdx,
phaseIdx,
activityIdx: -1,
conditionIdx: -1,
type: 'cast',
resultMd: highlighter(include.label),
});
}
});
}
phase.activities?.forEach((activity, activityIdx) => {
const { label = '', description, conditions = [], cast = [], attributes = [] } = activity;
Expand Down

0 comments on commit dce3630

Please sign in to comment.