diff --git a/src/app/components/shared/overlay/active-user/active-user.component.html b/src/app/components/shared/overlay/active-user/active-user.component.html index 4a05117685e6c71ecafd668b9d6c8963a299e2fd..53cd8d3a98b3d51438d7763c7b5261bebf0aae8e 100644 --- a/src/app/components/shared/overlay/active-user/active-user.component.html +++ b/src/app/components/shared/overlay/active-user/active-user.component.html @@ -1,4 +1,4 @@ -<div class="activityIcon" *ngIf="deviceType&&deviceType==='desktop'" [ngStyle]="{ +<div class="activityIcon" *ngIf="showByComponent" [ngStyle]="{ 'left':left+'px', 'top':top+'px' }" #divElement> diff --git a/src/app/components/shared/overlay/active-user/active-user.component.ts b/src/app/components/shared/overlay/active-user/active-user.component.ts index b11e6ba9d8de461fc0446e9def405611cb79ff4a..72482cf46d2479b48cdf4a5bf14af6260338fe34 100644 --- a/src/app/components/shared/overlay/active-user/active-user.component.ts +++ b/src/app/components/shared/overlay/active-user/active-user.component.ts @@ -22,6 +22,7 @@ export class ActiveUserComponent implements OnInit,OnDestroy{ onDestroyListener: (() => void)[]=[]; onValueChangeListener: ((user: number) => void)[]=[]; deviceType; + showByComponent: boolean; constructor( private activeUserService: ActiveUserService, @@ -32,9 +33,12 @@ export class ActiveUserComponent implements OnInit,OnDestroy{ ngOnInit(): void{ if(this.deviceType&&(this.deviceType==='mobile'||this.alwaysShowInHeader)){ + this.showByComponent=false; this.headerService.toggleCurrentUserActivity(true); this.onDestroyListener.push(()=>this.headerService.toggleCurrentUserActivity(false)); this.onValueChangeListener.push(num=>this.headerService.setCurrentUserActivity(num)); + } else{ + this.showByComponent=true; } this.onDestroyListener.push( this.activeUserService.observeUserActivity(this.room,user=>{