Commit c99b563 1 parent fdfc2a7 commit c99b563 Copy full SHA for c99b563
File tree 2 files changed +8
-11
lines changed
2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -78,10 +78,7 @@ setMessageStatus webSocket userId newStatus model =
78
78
model
79
79
{ contacts = updatedContacts
80
80
} /\
81
- [ setIt
82
- userId
83
- (messageIdsUpdated <<< DM .maybe [] _.history $ SIC .findContact userId model.contacts)
84
- updatedContacts
81
+ [ setIt userId (messageIdsUpdated <<< DM .maybe [] _.history $ SIC .findContact userId model.contacts)
85
82
]
86
83
87
84
where
@@ -94,16 +91,16 @@ setMessageStatus webSocket userId newStatus model =
94
91
| needsUpdate entry = entry { status = newStatus }
95
92
| otherwise = entry
96
93
97
- updateContact userId contact
98
- | contact.user.id == userId = contact { history = map updateStatus contact.history }
94
+ updateContact ui contact
95
+ | contact.user.id == ui = contact { history = map updateStatus contact.history }
99
96
| otherwise = contact
100
97
101
- setIt userId messages contacts = liftEffect do
98
+ setIt ui messages = liftEffect do
102
99
CIW .sendPayload webSocket $ ChangeStatus
103
100
{ status: newStatus
104
- , ids: [ Tuple userId messages ]
101
+ , ids: [ Tuple ui messages ]
105
102
}
106
- CIUN .updateTabCount userId contacts
103
+ CIUN .updateTabCount model.user.id updatedContacts
107
104
pure Nothing
108
105
109
106
-- | Update message status to unread upon openning the site or receveing from new contacts
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ tests = do
77
77
TU .test " sendMessage adds markdown image to history" do
78
78
date ← liftEffect $ map DateTimeWrapper EN .nowDateTime
79
79
let
80
- { chatting } = DT .fst <<< CIC .sendMessage 3 true (Image caption image) date webSocket $ model
80
+ { chatting } = DT .fst <<< CIC .sendMessage ( SU .fromJust model.chatting) true (Image caption image) date webSocket $ model
81
81
{ selectedImage = Just image
82
82
, imageCaption = Just caption
83
83
}
@@ -88,7 +88,7 @@ tests = do
88
88
TU .test " sendMessage resets input fields" do
89
89
date ← liftEffect $ map DateTimeWrapper EN .nowDateTime
90
90
let
91
- { selectedImage, imageCaption } = DT .fst <<< CIC .sendMessage 3 true content date webSocket $ model
91
+ { selectedImage, imageCaption } = DT .fst <<< CIC .sendMessage ( SU .fromJust model.chatting) true content date webSocket $ model
92
92
{ selectedImage = Just image
93
93
, imageCaption = Just caption
94
94
}
You can’t perform that action at this time.
0 commit comments