Fix font loading on web (#5412)
* Copy font files during build * Fall back if error loading fontszio/dev^2
parent
cbc7cd0808
commit
bda355fd58
|
@ -15,7 +15,7 @@
|
||||||
"web": "expo start --web",
|
"web": "expo start --web",
|
||||||
"use-build-number": "./scripts/useBuildNumberEnv.sh",
|
"use-build-number": "./scripts/useBuildNumberEnv.sh",
|
||||||
"use-build-number-with-bump": "./scripts/useBuildNumberEnvWithBump.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-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-ios": "yarn use-build-number-with-bump eas build -p ios",
|
||||||
"build-android": "yarn use-build-number-with-bump eas build -p android",
|
"build-android": "yarn use-build-number-with-bump eas build -p android",
|
||||||
|
|
|
@ -144,13 +144,13 @@ function InnerApp() {
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const [isReady, setReady] = useState(false)
|
const [isReady, setReady] = useState(false)
|
||||||
const [loaded] = useFonts()
|
const [loaded, error] = useFonts()
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
initPersistedState().then(() => setReady(true))
|
initPersistedState().then(() => setReady(true))
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
if (!isReady || !loaded) {
|
if (!isReady || (!loaded && !error)) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue