Skip to content

Commit b5b3beb

Browse files
Merge pull request #62881 from nextcloud/backport/62276/stable34
[stable34] fix(appstore): initialize the exApps store when enabled
2 parents 4f0eaf8 + bf168ee commit b5b3beb

3 files changed

Lines changed: 53 additions & 43 deletions

File tree

apps/appstore/src/store/apps.ts

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,38 @@ export const useAppsStore = defineStore('apps', () => {
231231
}
232232
}
233233

234+
// initialize store
235+
initialize()
236+
237+
return {
238+
apps,
239+
bundles,
240+
categories,
241+
isLoadingApps,
242+
isLoadingCategories,
243+
244+
disableApp,
245+
enableApp,
246+
uninstallApp,
247+
enableBundle,
248+
249+
getAppById,
250+
getAppsByCategory,
251+
getCategoryById,
252+
limitAppToGroups,
253+
}
254+
255+
/**
256+
* Initialize the store
257+
*/
258+
async function initialize() {
259+
await Promise.allSettled([
260+
loadApps(),
261+
loadCategories(),
262+
exApps.isEnabled ? exApps.initialize() : Promise.resolve(),
263+
])
264+
}
265+
234266
/**
235267
* Load the app categories from the backend
236268
*/
@@ -260,26 +292,4 @@ export const useAppsStore = defineStore('apps', () => {
260292
isLoadingApps.value = false
261293
}
262294
}
263-
264-
// initialize store
265-
loadApps()
266-
loadCategories()
267-
268-
return {
269-
apps,
270-
bundles,
271-
categories,
272-
isLoadingApps,
273-
isLoadingCategories,
274-
275-
disableApp,
276-
enableApp,
277-
uninstallApp,
278-
enableBundle,
279-
280-
getAppById,
281-
getAppsByCategory,
282-
getCategoryById,
283-
limitAppToGroups,
284-
}
285295
})

0 commit comments

Comments
 (0)