Use getSuggestions endpoint behind the gate (#3499)

* Move suggested follows out of the component

* Add new suggestions implementation

* Put new endpoint behind the gate

* Make bottom less weird
This commit is contained in:
dan 2024-04-12 13:02:15 +01:00 committed by GitHub
parent e3e8f10538
commit bedb0c3fbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 66 additions and 5 deletions

View file

@ -7,3 +7,4 @@ export type Gate =
| 'new_search'
| 'show_follow_back_label'
| 'start_session_with_following'
| 'use_new_suggestions_endpoint'

View file

@ -82,7 +82,10 @@ export function useGate(gateName: Gate): boolean {
// This should not happen because of waitForInitialization={true}.
console.error('Did not expected isLoading to ever be true.')
}
return value
// This shouldn't technically be necessary but let's get a strong
// guarantee that a gate value can never change while mounted.
const [initialValue] = React.useState(value)
return initialValue
}
function toStatsigUser(did: string | undefined) {