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.
|
|
|
|
*/
|
|
|
|
|
2023-01-16 11:41:54 +00:00
|
|
|
export const registerRealtimeEvents = (realtime) => {
|
|
|
|
realtime.registerEvent(
|
|
|
|
'permissions_updated',
|
2023-03-28 14:40:58 +00:00
|
|
|
({ store }, { workspace_id: workspaceId }) => {
|
|
|
|
if (
|
|
|
|
store.getters['workspace/haveWorkspacePermissionsBeenLoaded'](
|
|
|
|
workspaceId
|
|
|
|
)
|
|
|
|
) {
|
2024-02-02 12:55:28 +00:00
|
|
|
store.dispatch('toast/setPermissionsUpdated', true)
|
2023-01-16 11:41:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}
|