Page MenuHomePhabricator

D3431.id10394.diff
No OneTemporary

D3431.id10394.diff

diff --git a/lib/hooks/toggle-unread-status.js b/lib/hooks/toggle-unread-status.js
--- a/lib/hooks/toggle-unread-status.js
+++ b/lib/hooks/toggle-unread-status.js
@@ -19,16 +19,16 @@
afterAction: ?() => void,
): () => void {
const dispatchActionPromise = useDispatchActionPromise();
+ const { currentUser } = threadInfo;
const boundSetThreadUnreadStatus: (
request: SetThreadUnreadStatusRequest,
) => Promise<SetThreadUnreadStatusPayload> = useServerCall(
setThreadUnreadStatus,
);
const toggleUnreadStatus = React.useCallback(() => {
- const { unread } = threadInfo.currentUser;
const request = {
threadID: threadInfo.id,
- unread: !unread,
+ unread: !currentUser.unread,
latestMessage: mostRecentNonLocalMessage,
};
dispatchActionPromise(
@@ -37,14 +37,15 @@
undefined,
{
threadID: threadInfo.id,
- unread: !unread,
+ unread: !currentUser.unread,
},
);
if (afterAction) {
afterAction();
}
}, [
- threadInfo,
+ threadInfo.id,
+ currentUser.unread,
mostRecentNonLocalMessage,
dispatchActionPromise,
afterAction,

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 4:51 PM (21 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2576792
Default Alt Text
D3431.id10394.diff (1 KB)

Event Timeline