mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
various code quality fixes (#5792)
* various code quality fixes * reduce duplicated code * add safety check
This commit is contained in:
@@ -157,7 +157,7 @@ export class AuthenticationService {
|
||||
* @returns True if set, false otherwise
|
||||
*/
|
||||
isRememberMeSet(): boolean {
|
||||
return (this.cookie.getItem(REMEMBER_ME_COOKIE_KEY) === null) ? false : true;
|
||||
return (this.cookie.getItem(REMEMBER_ME_COOKIE_KEY) !== null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -287,10 +287,7 @@ export class IdentityGroupService {
|
||||
checkGroupHasClientApp(groupId: string, clientId: string): Observable<boolean> {
|
||||
return this.getClientRoles(groupId, clientId).pipe(
|
||||
map((response: any[]) => {
|
||||
if (response && response.length > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return response && response.length > 0;
|
||||
}),
|
||||
catchError((error) => this.handleError(error))
|
||||
);
|
||||
|
@@ -201,10 +201,7 @@ export class IdentityUserService {
|
||||
checkUserHasClientApp(userId: string, clientId: string): Observable<boolean> {
|
||||
return this.getClientRoles(userId, clientId).pipe(
|
||||
map((clientRoles: any[]) => {
|
||||
if (clientRoles.length > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return clientRoles.length > 0;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@@ -82,7 +82,7 @@ export class UploadService {
|
||||
* @returns True if a file is uploading, false otherwise
|
||||
*/
|
||||
isUploading(): boolean {
|
||||
return this.activeTask ? true : false;
|
||||
return !!this.activeTask;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user