1+ import { CommonModule , NgClass , NgForOf , NgIf } from '@angular/common' ;
12import { Component , OnDestroy , OnInit } from '@angular/core' ;
23import { GroupUser , User , UserGroup , UserGroupInfo } from 'src/app/models/user' ;
3- import { Observable , Subscription , first , forkJoin , tap } from 'rxjs' ;
4+ import { MatAccordion , MatExpansionModule } from '@angular/material/expansion' ;
5+ import { Observable , Subscription , first , forkJoin , take , tap } from 'rxjs' ;
46
57import { Angulartics2 } from 'angulartics2' ;
68import { Angulartics2OnModule } from 'angulartics2' ;
9+ import { CompanyService } from 'src/app/services/company.service' ;
710import { Connection } from 'src/app/models/connection' ;
811import { ConnectionsService } from 'src/app/services/connections.service' ;
912import { GroupAddDialogComponent } from './group-add-dialog/group-add-dialog.component' ;
1013import { GroupDeleteDialogComponent } from './group-delete-dialog/group-delete-dialog.component' ;
1114import { GroupNameEditDialogComponent } from './group-name-edit-dialog/group-name-edit-dialog.component' ;
1215import { MatButtonModule } from '@angular/material/button' ;
1316import { MatDialog } from '@angular/material/dialog' ;
14- import { MatAccordion , MatExpansionModule } from '@angular/material/expansion' ;
1517import { MatIconModule } from '@angular/material/icon' ;
1618import { MatListModule } from '@angular/material/list' ;
1719import { MatTooltipModule } from '@angular/material/tooltip' ;
18- import { CommonModule , NgClass , NgForOf , NgIf } from '@angular/common' ;
1920import { PermissionsAddDialogComponent } from './permissions-add-dialog/permissions-add-dialog.component' ;
2021import { PlaceholderUserGroupComponent } from '../skeletons/placeholder-user-group/placeholder-user-group.component' ;
2122import { PlaceholderUserGroupsComponent } from '../skeletons/placeholder-user-groups/placeholder-user-groups.component' ;
@@ -24,7 +25,6 @@ import { UserAddDialogComponent } from './user-add-dialog/user-add-dialog.compon
2425import { UserDeleteDialogComponent } from './user-delete-dialog/user-delete-dialog.component' ;
2526import { UserService } from 'src/app/services/user.service' ;
2627import { UsersService } from '../../services/users.service' ;
27- import { CompanyService } from 'src/app/services/company.service' ;
2828import { differenceBy } from "lodash" ;
2929
3030@Component ( {
@@ -71,9 +71,11 @@ export class UsersComponent implements OnInit, OnDestroy {
7171 ) { }
7272
7373 ngOnInit ( ) {
74- this . getTitleSubscription = this . _connections . getCurrentConnectionTitle ( ) . subscribe ( connectionTitle => {
75- this . title . setTitle ( `User permissions - ${ connectionTitle } | ${ this . _company . companyTabTitle || 'Rocketadmin' } ` ) ;
76- } ) ;
74+ this . _connections . getCurrentConnectionTitle ( )
75+ . pipe ( take ( 1 ) )
76+ . subscribe ( connectionTitle => {
77+ this . title . setTitle ( `User permissions - ${ connectionTitle } | ${ this . _company . companyTabTitle || 'Rocketadmin' } ` ) ;
78+ } ) ;
7779 this . connectionID = this . _connections . currentConnectionID ;
7880 this . getUsersGroups ( ) ;
7981
@@ -108,7 +110,6 @@ export class UsersComponent implements OnInit, OnDestroy {
108110 }
109111
110112 ngOnDestroy ( ) {
111- this . getTitleSubscription . unsubscribe ( ) ;
112113 this . usersSubscription . unsubscribe ( ) ;
113114 }
114115
0 commit comments