fix(mobile): stabilize preview login and asset build (#4853)

This commit is contained in:
DIYgod 2026-02-15 15:14:31 +08:00 committed by GitHub
parent b3371fc1fd
commit d4aa9f40d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 9 deletions

View File

@ -20,10 +20,11 @@ const isAssetReady = (assetsPath) => {
const withFollowAssets = (config, props) => {
if (!isAssetReady(props.assetsPath)) {
// TODO move to props
const cmd = `pnpm --filter @follow/rn-micro-web-app build --outDir ${path.resolve(props.assetsPath, "html-renderer")}`
// Build the web renderer directly to avoid workspace filter resolution issues on EAS workers.
const webAppDir = path.resolve(__dirname, "..", "web-app")
const cmd = `pnpm --dir ${webAppDir} build --outDir ${path.resolve(props.assetsPath, "html-renderer")}`
console.info(`Assets source directory not found! Running \`${cmd}\` to generate assets.`)
execSync(cmd)
execSync(cmd, { stdio: "inherit" })
}
if (!isAssetReady(props.assetsPath)) {
throw new Error(

View File

@ -9,12 +9,10 @@ export async function getTokenHeaders() {
const appCheckToken = await getLimitedUseToken(appCheck)
token = appCheckToken.token
} catch (error) {
console.error("error", error)
console.warn("[app-check] failed to get limited-use token, fallback to synthetic token", error)
}
return token
? {
"x-token": `ac:${token}`,
}
: undefined
return {
"x-token": `ac:${token || "fallback"}`,
}
}