mirror of
https://github.com/outline/outline.git
synced 2026-11-22 14:01:41 +03:00
fix: reload policies upon collection permission change
This commit is contained in:
1 parent
a398cabe68
commit
e6d8ca9b3d
1 file changed
+7
-2
@@ -44,6 +44,7 @@ export default abstract class Model {
|
||||
if (!relations) {
|
||||
return;
|
||||
}
|
||||
// this is to ensure that multiple loads don’t happen in parallel
|
||||
if (this.loadingRelations) {
|
||||
return this.loadingRelations;
|
||||
}
|
||||
@@ -64,8 +65,12 @@ export default abstract class Model {
|
||||
promises.push(this.store.fetch(this.id, { force: true }));
|
||||
}
|
||||
|
||||
this.loadingRelations = Promise.all(promises);
|
||||
return await this.loadingRelations;
|
||||
try {
|
||||
this.loadingRelations = Promise.all(promises);
|
||||
return await this.loadingRelations;
|
||||
} finally {
|
||||
this.loadingRelations = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user