MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / getSelectedThreadId

Function getSelectedThreadId

apps/web/components/Pages/Channel/index.tsx:129–144  ·  view source on GitHub ↗
(
  currentChannel: SerializedChannel,
  initialThreads: SerializedThread[]
)

Source from the content-addressed store, hash-verified

127}
128
129function 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}

Callers 1

ChannelFunction · 0.85

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected