fix: Clear document policies when public sharing option is updated
closes #5461
This commit is contained in:
@@ -287,6 +287,15 @@ class WebsocketProvider extends React.Component<Props> {
|
||||
});
|
||||
|
||||
this.socket.on("collections.update", (event: PartialWithId<Collection>) => {
|
||||
if (
|
||||
"sharing" in event &&
|
||||
event.sharing !== collections.get(event.id)?.sharing
|
||||
) {
|
||||
documents.all.forEach((document) => {
|
||||
policies.remove(document.id);
|
||||
});
|
||||
}
|
||||
|
||||
collections.add(event);
|
||||
});
|
||||
|
||||
@@ -313,6 +322,12 @@ class WebsocketProvider extends React.Component<Props> {
|
||||
);
|
||||
|
||||
this.socket.on("teams.update", (event: PartialWithId<Team>) => {
|
||||
if ("sharing" in event && event.sharing !== auth.team?.sharing) {
|
||||
documents.all.forEach((document) => {
|
||||
policies.remove(document.id);
|
||||
});
|
||||
}
|
||||
|
||||
auth.team?.updateFromJson(event);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user