Skip to content

Commit

Permalink
Handle on going consultation when algorithm change
Browse files Browse the repository at this point in the history
  • Loading branch information
quentingirard committed May 24, 2022
1 parent aac5049 commit 023296c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Containers/Auth/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const LoginAuthContainer = () => {
__DEV__ ? 'http://195.15.219.241' : '',
)

const [clientId, setClientId] = useState(__DEV__ ? '1335' : '')
const [clientId, setClientId] = useState(__DEV__ ? '1806' : '')

// Define references
const fadeAnim = useRef(new Animated.Value(0)).current
Expand Down
12 changes: 10 additions & 2 deletions src/Containers/Patient/Consultations.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ const ConsultationPatientContainer = ({ navigation }) => {

// Local state definition
const [currentConsultation, setCurrentConsultation] = useState(
patient.medicalCases.find(medicalCase => medicalCase.closedAt === 0),
patient.medicalCases.find(
medicalCase =>
medicalCase.closedAt === 0 &&
medicalCase.version_id === algorithm.version_id,
),
)
const [closedCases, setClosedCases] = useState(
orderBy(
Expand All @@ -62,7 +66,11 @@ const ConsultationPatientContainer = ({ navigation }) => {
*/
useEffect(() => {
setCurrentConsultation(
patient.medicalCases.find(medicalCase => medicalCase.closedAt === 0),
patient.medicalCases.find(
medicalCase =>
medicalCase.closedAt === 0 &&
medicalCase.version_id === algorithm.version_id,
),
)
setClosedCases(
orderBy(
Expand Down

0 comments on commit 023296c

Please sign in to comment.