From 2d2c57a871513f21d8d92e9212c174c7c574dcfc Mon Sep 17 00:00:00 2001
From: Lukas Haase <lukas.haase@mni.thm.de>
Date: Wed, 18 Aug 2021 10:48:21 +0200
Subject: [PATCH] fix dublication error, when selecting param
 alwaysshowinheader do not show in-component user counter

---
 .../shared/overlay/active-user/active-user.component.html     | 2 +-
 .../shared/overlay/active-user/active-user.component.ts       | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

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 4a0511768..53cd8d3a9 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 b11e6ba9d..72482cf46 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=>{
-- 
GitLab