Group membership change propegation
Summary
Closes #2228
This MR makes it so that when joining, leaving, creating and destroying a group, the sidebar updates without the user having to refresh.
Steps to test
Create and Delete
- Log in.
- Create a new group.
- Check the sidebar has the new group without you having to reload.
- Delete the group, it should now be gone.
Leave and Join
- Join a group that you are not an admin of.
- Leave the group - it should now be gone from the sidebar.
- Rejoin, it should be back.
Estimated Regression Scope
GroupsService, The group sidebar have been the main focus of this change, most of the logical changes are in there.
I've also touched two other areas due to errors flooding my console when testing:
Avatar component, the only change is an extra condition in an if statement, so I don't see much of an issue with that but note it has been touched.
Other than that some changeDetection was added to the videochat component.
added scoped labels
39 39 this.isActive = false; 40 40 } 41 41 this.cd.markForCheck(); 42 this.cd.detectChanges(); 42 if (!this.cd['destroyed']) { 43 this.cd.detectChanges(); 44 } 43 45 } 44 46 ); 45 47 } 46 48 47 49 ngOnDestroy() { 50 this.cd.detach(); 48 51 this.service.deactivate(); - Developer
Not related to this change per se, but trying to use a destroyed change detector was flooding the console; this is likely somewhere in sentry but I could not find the issue.
130 130 * @returns true if the object guid matches the currently logged in user guid 131 131 */ 132 132 isOwnerAvatar(): boolean { 133 return this.minds.user && this.object.guid === this.minds.user.guid; 133 return ( 134 this.minds.user && 135 this.object && 136 this.object.guid === this.minds.user.guid 137 ); 134 138 } - Developer
Fixes #2403
Added in here because it made monitoring console for errors very annoying.