Skip to content

Commit

Permalink
[CP-3311] Metada refresh via tmp workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarski committed Dec 9, 2024
1 parent fc7d45a commit b75f741
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions libs/generic-view/store/src/lib/outbox/get-outbox-data.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { selectActiveApiDeviceId } from "../selectors/select-active-api-device-i
import { setLastRefresh } from "../views/actions"
import { getEntityDataAction } from "../entities/get-entity-data.action"
import { deleteEntityData, setEntityData } from "../entities/actions"
import { getEntitiesMetadataAction } from "../entities/get-entities-metadata.action"

export const getOutboxData = createAsyncThunk<
{
Expand Down Expand Up @@ -44,13 +45,27 @@ export const getOutboxData = createAsyncThunk<
return !featuresToFullReload.includes(feature)
})

featuresToFullReload.forEach(async (feature) => {
for (const feature of featuresToFullReload) {
await dispatch(getSingleFeatures({ deviceId, feature }))
})
}

dataToReload.forEach(async (feature) => {
for (const feature of dataToReload) {
await dispatch(getSingleFeatureData({ deviceId, feature }))
})
}

// TODO: handle tmp solution after handle https://appnroll.atlassian.net/browse/CP-3216
if (dataToReload.find((feature) => feature === "fileManager")) {
for (const entitiesType of [
"audioFiles",
"imageFiles",
"ebookFiles",
"applicationFiles",
]) {
void (await dispatch(
getEntitiesMetadataAction({ entitiesType, deviceId })
))
}
}
}

if (response.data.entities && response.data.entities.length > 0) {
Expand Down

0 comments on commit b75f741

Please sign in to comment.