fix: Improved handling of delete events from collection and document sockets (#1517)

* handle delete events fron collection and document sockets

* handle collection deletes to documents

* rework semantics to always reload after a delete

Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
Nan Yu
2020-09-07 19:05:10 -07:00
committed by GitHub
parent ceeac9b982
commit e7ab2939d4
4 changed files with 54 additions and 16 deletions

View File

@@ -50,7 +50,8 @@ class DataLoader extends React.Component<Props> {
// reload from the server otherwise the UI will not know which authorizations
// the user has
if (this.document) {
const policy = this.props.policies.get(this.document.id);
const document = this.document;
const policy = this.props.policies.get(document.id);
if (!policy && !this.error) {
this.loadDocument();