Skip to content

Commit

Permalink
fix: Request only triggers for worker and clisk
Browse files Browse the repository at this point in the history
  • Loading branch information
Crash-- committed Oct 18, 2023
1 parent 53f7b5f commit 804231f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/components/appEntryPoint.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ const OLDER_THAN_THIRTY_SECONDS = CozyClient.fetchPolicies.olderThan(30 * 1000)
const appEntryPoint = queryConnect({
accounts: {
query: () => Q(ACCOUNT_DOCTYPE),
as: 'accounts',
as: 'io.cozy.accounts',
fetchPolicy: OLDER_THAN_THIRTY_SECONDS
},
konnectors: {
query: () => Q(KONNECTOR_DOCTYPE),
as: 'konnectors',
as: 'io.cozy.konnectors',
fetchPolicy: OLDER_THAN_THIRTY_SECONDS
},
triggers: {
query: () => Q(TRIGGER_DOCTYPE),
as: 'triggers',
query: () => Q(TRIGGER_DOCTYPE).where({ worker: ['client', 'konnector'] }),
as: 'io.cozy.triggers/by_worker_client_konnector',
fetchPolicy: OLDER_THAN_THIRTY_SECONDS
}
})
Expand Down
8 changes: 5 additions & 3 deletions src/containers/ReloadFocus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ class RealoadFocus extends React.Component {
componentDidMount() {
const client = this.props.client
window.addEventListener('focus', () => {
client.query(Q('io.cozy.jobs'))
client.query(Q('io.cozy.triggers'))
client.query(Q('io.cozy.apps'))
client.query(Q('io.cozy.jobs')),
client.query(
Q('io.cozy.triggers').where({ worker: ['client', 'konnector'] })
),
client.query(Q('io.cozy.apps'))
})
}

Expand Down

0 comments on commit 804231f

Please sign in to comment.