Page MenuHomePhabricator

D3388.diff
No OneTemporary

D3388.diff

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

Mime Type
text/plain
Expires
Sun, Nov 17, 10:21 PM (21 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2532101
Default Alt Text
D3388.diff (1 KB)

Event Timeline