Skip to content

Commit

Permalink
Merge pull request #790 from BIDMCDigitalPsychiatry/issue-782
Browse files Browse the repository at this point in the history
Issue-782 changes
  • Loading branch information
sarithapillai8 authored Nov 2, 2023
2 parents 74c5a4c + 53df001 commit fb01c32
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions src/components/NotificationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,23 +148,10 @@ export default function NotificationPage({ participant, activityId, mode, tab, .
Service.getUserDataByKey("activitytags", [activityId], "id").then((tags) => {
setTag(tags[0])
const tag = tags[0]
if (data.spec == "lamp.spin_wheel") {
;(async () => {
const events = await LAMP.ActivityEvent.allByParticipant(participant)
const balance = findLastEvent(events, activityId, data.settings?.balance ?? 2000)
data["settings"]["balance"] = balance
data = spliceCTActivity({ raw: data, tag })
setActivity(data)
setLoading(false)
})()
} else {
data =
data.spec === "lamp.survey"
? spliceActivity({ raw: data, tag })
: spliceCTActivity({ raw: data, tag })
setActivity(data)
setLoading(false)
}
data =
data.spec === "lamp.survey" ? spliceActivity({ raw: data, tag }) : spliceCTActivity({ raw: data, tag })
setActivity(data)
setLoading(false)
})
} else {
setOpenNotFound(true)
Expand Down

0 comments on commit fb01c32

Please sign in to comment.