Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3296084
D3388.id10292.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3388.id10292.diff
View Options
diff --git a/web/sidebar/app-switcher.react.js b/web/sidebar/app-switcher.react.js
--- a/web/sidebar/app-switcher.react.js
+++ b/web/sidebar/app-switcher.react.js
@@ -1,6 +1,5 @@
// @flow
-import invariant from 'invariant';
import * as React from 'react';
import { useDispatch } from 'react-redux';
@@ -20,7 +19,7 @@
state => state.navInfo.activeChatThreadID,
);
const mostRecentlyReadThread = useSelector(mostRecentlyReadThreadSelector);
- const activeThreadCurrentlyUnread = useSelector(
+ const isActiveThreadCurrentlyUnread = useSelector(
state =>
!activeChatThreadID ||
!!state.threadStore.threadInfos[activeChatThreadID]?.currentUser.unread,
@@ -35,7 +34,7 @@
type: updateNavInfoActionType,
payload: {
tab: 'chat',
- activeChatThreadID: activeThreadCurrentlyUnread
+ activeChatThreadID: isActiveThreadCurrentlyUnread
? mostRecentlyReadThread
: activeChatThreadID,
},
@@ -43,19 +42,14 @@
},
[
dispatch,
- activeThreadCurrentlyUnread,
+ isActiveThreadCurrentlyUnread,
mostRecentlyReadThread,
activeChatThreadID,
],
);
- const viewerID = useSelector(
- state => state.currentUserInfo && state.currentUserInfo.id,
- );
-
const boundUnreadCount = useSelector(unreadCount);
- invariant(viewerID, 'should be set');
let chatBadge = null;
if (boundUnreadCount > 0) {
chatBadge = <span className={css.chatBadge}>{boundUnreadCount}</span>;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 12:42 AM (22 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2532101
Default Alt Text
D3388.id10292.diff (1 KB)
Attached To
Mode
D3388: [web] Address remaining code review comments from D3341
Attached
Detach File
Event Timeline
Log In to Comment