Skip to content

Commit

Permalink
feat: Hide apps by flag
Browse files Browse the repository at this point in the history
The `apps.hidden` flag will be used to hide apps in home, store and bar
  • Loading branch information
paultranvan committed Nov 19, 2024
1 parent b0cc85c commit 1b9ae06
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/reducers/apps.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import stack from 'lib/stack'
import unionWith from 'lodash.unionwith'
import flag from 'cozy-flags'

// constants
const DELETE_APP = 'DELETE_APP'
Expand Down Expand Up @@ -46,7 +47,10 @@ export const fetchApps = () => async dispatch => {
try {
dispatch({ type: FETCH_APPS })
const rawAppList = await stack.get.apps()
const apps = rawAppList.map(mapApp)
const excludedApps = flag('apps.hidden') || []
const apps = rawAppList
.map(mapApp)
.filter(app => !excludedApps.includes(app))
if (!rawAppList.length)
throw new Error('No installed apps found by the bar')
// TODO load only one time icons
Expand Down

0 comments on commit 1b9ae06

Please sign in to comment.