Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32768897
nav-reducer.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1005 B
Referenced Files
None
Subscribers
None
nav-reducer.js
View Options
// @flow
import
{
locallyUniqueToRealizedThreadIDsSelector
}
from
'lib/selectors/thread-selectors'
;
import
type
{
RawThreadInfo
}
from
'lib/types/thread-types'
;
import
type
{
Action
}
from
'../redux/redux-setup'
;
import
{
type
NavInfo
,
updateNavInfoActionType
}
from
'../types/nav-types'
;
export
default
function
reduceNavInfo
(
oldState
:
NavInfo
,
action
:
Action
,
newThreadInfos
:
{
+
[
id
:
string
]
:
RawThreadInfo
},
)
:
NavInfo
{
let
state
=
oldState
;
if
(
action
.
type
===
updateNavInfoActionType
)
{
state
=
{
...
state
,
...
action
.
payload
,
};
}
const
{
activeChatThreadID
}
=
state
;
if
(
activeChatThreadID
)
{
const
locallyUniqueToRealizedThreadIDs
=
locallyUniqueToRealizedThreadIDsSelector
(
newThreadInfos
,
);
const
realizedThreadID
=
locallyUniqueToRealizedThreadIDs
.
get
(
activeChatThreadID
,
);
if
(
realizedThreadID
)
{
state
=
{
...
state
,
activeChatThreadID
:
realizedThreadID
,
};
}
}
return
state
;
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Fri, Jan 9, 1:27 PM (21 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5905060
Default Alt Text
nav-reducer.js (1005 B)
Attached To
Mode
rCOMM Comm
Attached
Detach File
Event Timeline
Log In to Comment