mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
22 lines
614 B
TypeScript
22 lines
614 B
TypeScript
import { Page, PageType } from '../elastic/types'
|
|
import { ContentReader } from '../generated/graphql'
|
|
import { contentReaderForPageType } from '../utils/uploads'
|
|
import { FeatureName, isOptedIn } from './features'
|
|
|
|
/*
|
|
* We should synthesize the page when user is opted in to the feature
|
|
*/
|
|
export const shouldSynthesize = async (
|
|
userId: string,
|
|
page: Page
|
|
): Promise<boolean> => {
|
|
if (
|
|
contentReaderForPageType(page.pageType) !== ContentReader.Web ||
|
|
!page.content
|
|
) {
|
|
// we don't synthesize files for now
|
|
return false
|
|
}
|
|
|
|
return isOptedIn(FeatureName.UltraRealisticVoice, userId)
|
|
}
|