Fix TT index.tsx quote escaping that broke Babel compile.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
534400f554
commit
ea0786ea9d
@ -1,21 +1,21 @@
|
|||||||
/**
|
/**
|
||||||
* 抖音启动页:默认 BMI(过审);homeVariant=hub 时跳正式门户
|
* ???????? BMI?????homeVariant=hub ??????
|
||||||
* 每次 onShow 强制拉配置,后台切换首页可近实时生效
|
* ?? onShow ??????????????????
|
||||||
*/
|
*/
|
||||||
import { useEffect, useState } from \'react\'
|
import { useEffect, useState } from 'react'
|
||||||
import Taro, { useDidShow } from \'@tarojs/taro\'
|
import Taro, { useDidShow } from '@tarojs/taro'
|
||||||
import {
|
import {
|
||||||
getCachedRemoteConfig,
|
getCachedRemoteConfig,
|
||||||
loadRemoteConfig,
|
loadRemoteConfig,
|
||||||
} from \'@/services/remoteConfig\'
|
} from '@/services/remoteConfig'
|
||||||
import {
|
import {
|
||||||
resolveTtHomeVariantFromConfig,
|
resolveTtHomeVariantFromConfig,
|
||||||
type NomadroRemoteConfig,
|
type NomadroRemoteConfig,
|
||||||
} from \'@/data/remoteConfig.defaults\'
|
} from '@/data/remoteConfig.defaults'
|
||||||
import { useNomadroTheme } from \'@/utils/h5Theme\'
|
import { useNomadroTheme } from '@/utils/h5Theme'
|
||||||
import BmiHome from \'./BmiHome\'
|
import BmiHome from './BmiHome'
|
||||||
|
|
||||||
const HUB_PATH = \'/pages/hub/index\'
|
const HUB_PATH = '/pages/hub/index'
|
||||||
|
|
||||||
export default function IndexPage() {
|
export default function IndexPage() {
|
||||||
const [config, setConfig] = useState<NomadroRemoteConfig>(() => getCachedRemoteConfig())
|
const [config, setConfig] = useState<NomadroRemoteConfig>(() => getCachedRemoteConfig())
|
||||||
@ -25,7 +25,7 @@ export default function IndexPage() {
|
|||||||
async function syncVariant(force = false) {
|
async function syncVariant(force = false) {
|
||||||
const r = await loadRemoteConfig(force)
|
const r = await loadRemoteConfig(force)
|
||||||
setConfig(r.config)
|
setConfig(r.config)
|
||||||
if (resolveTtHomeVariantFromConfig(r.config) === \'hub\') {
|
if (resolveTtHomeVariantFromConfig(r.config) === 'hub') {
|
||||||
Taro.reLaunch({ url: HUB_PATH })
|
Taro.reLaunch({ url: HUB_PATH })
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -38,7 +38,7 @@ export default function IndexPage() {
|
|||||||
syncVariant(true).then((ok) => {
|
syncVariant(true).then((ok) => {
|
||||||
if (cancelled || !ok) return
|
if (cancelled || !ok) return
|
||||||
})
|
})
|
||||||
if (resolveTtHomeVariantFromConfig(getCachedRemoteConfig()) !== \'hub\') {
|
if (resolveTtHomeVariantFromConfig(getCachedRemoteConfig()) !== 'hub') {
|
||||||
setReady(true)
|
setReady(true)
|
||||||
}
|
}
|
||||||
return () => {
|
return () => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user