Skip to content

Commit

Permalink
chore: fix lock page for team users
Browse files Browse the repository at this point in the history
  • Loading branch information
rick-rtt committed Nov 28, 2023
1 parent 6d6d26d commit d7c098b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/desktop-app/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { PluginManagerService } from "@noovolari/leapp-core/plugin-sdk/plugin-ma
import { ExtensionWebsocketService } from "./services/extension-websocket.service";
import { TeamService } from "./services/team-service";
import { AnalyticsService } from "./services/analytics.service";
import { Role } from "./leapp-team-core/user/role";

@Component({
selector: "app-root",
Expand Down Expand Up @@ -201,8 +202,9 @@ export class AppComponent implements OnInit {
// Go to initial page if no sessions are already created or
// go to the list page if is your second visit.
// If there is a pro user registered go to login page instead
if (this.teamService.signedInUserState.getValue()?.role === "pro" || teamMemberEmail !== undefined) {
if (this.teamService.signedInUserState.getValue()?.role === "pro") {
const userRole = this.teamService.signedInUserState.getValue()?.role;
if (userRole === Role.pro || userRole === Role.user || userRole === Role.manager || teamMemberEmail !== undefined) {
if (userRole === Role.pro || ((userRole === Role.user || userRole === Role.manager) && teamMemberEmail === undefined)) {
await this.router.navigate(["/lock"]);
} else if (
teamMemberEmail !== undefined &&
Expand Down

0 comments on commit d7c098b

Please sign in to comment.