Merge branch 'loader-fixes' into 'develop'

Loader fixes

See merge request pleroma/pleroma-fe!1954
This commit is contained in:
HJ 2024-12-18 15:20:52 +00:00
commit b0e687692a
7 changed files with 145 additions and 103 deletions

View file

@ -118,7 +118,12 @@ export const tryLoadCache = async () => {
}
}
export const applyTheme = (input, onFinish = (data) => {}, debug) => {
export const applyTheme = (
input,
onEagerFinish = data => {},
onFinish = data => {},
debug
) => {
const eagerStyles = createStyleSheet(EAGER_STYLE_ID)
const lazyStyles = createStyleSheet(LAZY_STYLE_ID)
@ -148,6 +153,7 @@ export const applyTheme = (input, onFinish = (data) => {}, debug) => {
},
onEagerFinished () {
adoptStyleSheets([eagerStyles])
onEagerFinish()
},
onLazyFinished () {
adoptStyleSheets([eagerStyles, lazyStyles])