Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 32 additions & 22 deletions apps/appstore/src/store/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,38 @@ export const useAppsStore = defineStore('apps', () => {
}
}

// initialize store
initialize()

return {
apps,
bundles,
categories,
isLoadingApps,
isLoadingCategories,

disableApp,
enableApp,
uninstallApp,
enableBundle,

getAppById,
getAppsByCategory,
getCategoryById,
limitAppToGroups,
}

/**
* Initialize the store
*/
async function initialize() {
await Promise.allSettled([
loadApps(),
loadCategories(),
exApps.isEnabled ? exApps.initialize() : Promise.resolve(),
])
}

/**
* Load the app categories from the backend
*/
Expand Down Expand Up @@ -260,26 +292,4 @@ export const useAppsStore = defineStore('apps', () => {
isLoadingApps.value = false
}
}

// initialize store
loadApps()
loadCategories()

return {
apps,
bundles,
categories,
isLoadingApps,
isLoadingCategories,

disableApp,
enableApp,
uninstallApp,
enableBundle,

getAppById,
getAppsByCategory,
getCategoryById,
limitAppToGroups,
}
})
Loading