From c2406fcc0397f7810d4a55eecf747ad77df0a9aa Mon Sep 17 00:00:00 2001 From: Sean Date: Wed, 25 Mar 2020 12:18:57 +0100 Subject: [PATCH] Remove counting of IndexedDB and LocalStore Mainly simplify the user counting component. It seems that counting IndexedDB has no value anymore, since even Firefox ESR uses IndexedDB just fine and the LS fallback proves to be reliable enough --- .../src/app/core/ui-services/count-users.service.ts | 4 +--- .../count-users/count-users.component.html | 13 ++++++------- .../services/count-user-statistics.service.ts | 5 ----- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/client/src/app/core/ui-services/count-users.service.ts b/client/src/app/core/ui-services/count-users.service.ts index dede276d8..91ea7a9ec 100644 --- a/client/src/app/core/ui-services/count-users.service.ts +++ b/client/src/app/core/ui-services/count-users.service.ts @@ -11,7 +11,6 @@ interface CountUserRequest { export interface CountUserData { userId: number; - usesIndexedDB: boolean; } interface CountUserResponse extends CountUserRequest { @@ -49,8 +48,7 @@ export class CountUsersService { { token: request.content.token, data: { - userId: this.currentUserId, - usesIndexedDB: true + userId: this.currentUserId } }, request.senderChannelName diff --git a/client/src/app/site/common/components/count-users/count-users.component.html b/client/src/app/site/common/components/count-users/count-users.component.html index 7350ec698..f374b667f 100644 --- a/client/src/app/site/common/components/count-users/count-users.component.html +++ b/client/src/app/site/common/components/count-users/count-users.component.html @@ -7,17 +7,16 @@

- {{ userIds().length }} active users - ({{ stats.usesIndexedDB }} with indexedDB, - {{ stats.activeUserHandles-stats.usesIndexedDB }} with local storage) - ({{ stats.activeUserHandles }} connections) + {{ userIds().length }} active users ({{ stats.activeUserHandles }} + connections)

Groups

diff --git a/client/src/app/site/common/services/count-user-statistics.service.ts b/client/src/app/site/common/services/count-user-statistics.service.ts index 734e9ea7b..9f0ae649b 100644 --- a/client/src/app/site/common/services/count-user-statistics.service.ts +++ b/client/src/app/site/common/services/count-user-statistics.service.ts @@ -10,7 +10,6 @@ import { CountUserData, CountUsersService } from 'app/core/ui-services/count-use */ export interface CountUserStatistics { activeUserHandles: number; - usesIndexedDB: number; activeUsers: { [id: number]: number; }; @@ -52,7 +51,6 @@ export class CountUsersStatisticsService { [token, userDataObservable] = this.countUserService.countUsers(); this.runningCounts[token] = new BehaviorSubject({ activeUserHandles: 0, - usesIndexedDB: 0, activeUsers: {}, groups: {} }); @@ -66,9 +64,6 @@ export class CountUsersStatisticsService { // Add to user stats stats.activeUserHandles++; - if (data.usesIndexedDB) { - stats.usesIndexedDB++; - } if (!stats.activeUsers[userId]) { stats.activeUsers[userId] = 0; }