Function
getSelectedThreadId
(
currentChannel: SerializedChannel,
initialThreads: SerializedThread[]
)
Source from the content-addressed store, hash-verified
| 127 | } |
| 128 | |
| 129 | function getSelectedThreadId( |
| 130 | currentChannel: SerializedChannel, |
| 131 | initialThreads: SerializedThread[] |
| 132 | ) { |
| 133 | if ( |
| 134 | currentChannel.viewType === 'CHAT' && |
| 135 | typeof window !== 'undefined' && |
| 136 | window.location.hash |
| 137 | ) { |
| 138 | const hash = window.location.hash.split('#').join(''); |
| 139 | if (hash && initialThreads.map(({ id }) => id).includes(hash)) { |
| 140 | return hash; |
| 141 | } |
| 142 | } |
| 143 | return; |
| 144 | } |
Tested by
no test coverage detected