Skip to content

Commit 630aa42

Browse files
committed
feat: Delay icon's caching manager 30s after startup
Icons caching may slow down the startup process but is not necessary for the app to work If not called in time, this would only impact cozy-apps opening animation that will use generic icons (if never called before) or potentially old icons (in the rare cases when we update a cozy-app icon) So we chose to delay this call a short delay after the startup (for now 30s)
1 parent 15831d5 commit 630aa42

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/hooks/useAppBootstrap.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import { useHomeStateContext } from '/screens/home/HomeStateProvider'
2525

2626
const log = Minilog('useAppBootstrap')
2727

28+
const MANAGE_ICON_CACHE_DELAY_IN_MS = 30 * 1000
29+
2830
export const useAppBootstrap = client => {
2931
const [markName] = useState(() => rnperformance.mark('useAppBootstrap'))
3032
const [initialRoute, setInitialRoute] = useState('fetching')
@@ -176,7 +178,8 @@ export const useAppBootstrap = client => {
176178
return
177179
}
178180

179-
client && manageIconCache(client)
181+
client &&
182+
setTimeout(() => manageIconCache(client), MANAGE_ICON_CACHE_DELAY_IN_MS)
180183
client && setSentryTag(SentryCustomTags.Instance, client.stackClient?.uri)
181184

182185
const subscription = Linking.addEventListener('url', ({ url }) => {

0 commit comments

Comments
 (0)