From bda355fd58a06b5fe7cf58a12d32769f75112a4f Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 18 Sep 2024 20:22:03 -0500 Subject: [PATCH] Fix font loading on web (#5412) * Copy font files during build * Fall back if error loading fonts --- package.json | 2 +- src/App.web.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ba788290..09985de0 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "web": "expo start --web", "use-build-number": "./scripts/useBuildNumberEnv.sh", "use-build-number-with-bump": "./scripts/useBuildNumberEnvWithBump.sh", - "build-web": "expo export:web && node ./scripts/post-web-build.js && cp -v ./web-build/static/js/*.* ./bskyweb/static/js/ && cp -v ./web-build/static/media/*.png ./bskyweb/static/media/", + "build-web": "expo export:web && node ./scripts/post-web-build.js && cp -v ./web-build/static/js/*.* ./bskyweb/static/js/ && cp -v ./web-build/static/media/* ./bskyweb/static/media/", "build-all": "yarn intl:build && yarn use-build-number-with-bump eas build --platform all", "build-ios": "yarn use-build-number-with-bump eas build -p ios", "build-android": "yarn use-build-number-with-bump eas build -p android", diff --git a/src/App.web.tsx b/src/App.web.tsx index 1c665073..846d178f 100644 --- a/src/App.web.tsx +++ b/src/App.web.tsx @@ -144,13 +144,13 @@ function InnerApp() { function App() { const [isReady, setReady] = useState(false) - const [loaded] = useFonts() + const [loaded, error] = useFonts() React.useEffect(() => { initPersistedState().then(() => setReady(true)) }, []) - if (!isReady || !loaded) { + if (!isReady || (!loaded && !error)) { return null }