-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize the caching of some more cluster fields plus other changes (#…
- Loading branch information
1 parent
172893f
commit c5ec408
Showing
50 changed files
with
1,284 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { LoginContext } from 'components/contexts' | ||
import { useContext, useMemo } from 'react' | ||
|
||
export function useStreamTopic({ | ||
insightId, | ||
scopeId, | ||
threadId, | ||
}: { | ||
insightId?: string | ||
scopeId?: string | ||
threadId?: string | ||
}) { | ||
const { me } = useContext(LoginContext) | ||
return useMemo(() => { | ||
if (insightId) { | ||
return `ai:insight:${insightId}:${me?.id}` | ||
} | ||
|
||
if (threadId) { | ||
return `ai:thread:${threadId}:${me?.id}` | ||
} | ||
|
||
return `ai:freeform:${scopeId}:${me?.id}` | ||
}, [insightId, threadId, scopeId, me]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.