1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-05-18 06:41:02 +00:00
bramw_baserow/enterprise/web-frontend/modules/baserow_enterprise/realtime.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
544 B
JavaScript
Raw Permalink Normal View History

2022-09-20 15:31:46 +02:00
/**
* Registers the real time events related to the baserow_enterprise module. When a message
* comes in, the state of the stores will be updated to match the latest update.
*/
export const registerRealtimeEvents = (realtime) => {
realtime.registerEvent(
'permissions_updated',
({ store }, { workspace_id: workspaceId }) => {
if (
store.getters['workspace/haveWorkspacePermissionsBeenLoaded'](
workspaceId
)
) {
store.dispatch('toast/setPermissionsUpdated', true)
}
}
)
}