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
This commit is contained in:
parent
91be76a263
commit
c2406fcc03
@ -11,7 +11,6 @@ interface CountUserRequest {
|
|||||||
|
|
||||||
export interface CountUserData {
|
export interface CountUserData {
|
||||||
userId: number;
|
userId: number;
|
||||||
usesIndexedDB: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CountUserResponse extends CountUserRequest {
|
interface CountUserResponse extends CountUserRequest {
|
||||||
@ -49,8 +48,7 @@ export class CountUsersService {
|
|||||||
{
|
{
|
||||||
token: request.content.token,
|
token: request.content.token,
|
||||||
data: {
|
data: {
|
||||||
userId: this.currentUserId,
|
userId: this.currentUserId
|
||||||
usesIndexedDB: true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
request.senderChannelName
|
request.senderChannelName
|
||||||
|
@ -7,17 +7,16 @@
|
|||||||
</button>
|
</button>
|
||||||
<div *ngIf="stats">
|
<div *ngIf="stats">
|
||||||
<p>
|
<p>
|
||||||
{{ userIds().length }} <span translate>active users</span>
|
{{ userIds().length }} <span translate>active users</span> ({{ stats.activeUserHandles }}
|
||||||
({{ stats.usesIndexedDB }} <span translate>with indexedDB</span>,
|
<span translate>connections</span>)
|
||||||
{{ stats.activeUserHandles-stats.usesIndexedDB }} <span translate>with local storage</span>)
|
|
||||||
({{ stats.activeUserHandles }} <span translate>connections</span>)
|
|
||||||
</p>
|
</p>
|
||||||
<h3 translate>Groups</h3>
|
<h3 translate>Groups</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="let groupId of groupIds()">
|
<li *ngFor="let groupId of groupIds()">
|
||||||
<strong>{{ stats.groups[groupId].name }}</strong>:
|
<strong>{{ stats.groups[groupId].name }}</strong>
|
||||||
{{ userInGroupIds(groupId).length }} <span translate>active users</span>
|
<span> : {{ userInGroupIds(groupId).length }} </span>
|
||||||
({{ stats.groups[groupId].userHandleCount }} <span translate>connections</span>)
|
<span translate>active users</span>
|
||||||
|
(<span>{{ stats.groups[groupId].userHandleCount }}</span> <span translate>connections</span>)
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,7 +10,6 @@ import { CountUserData, CountUsersService } from 'app/core/ui-services/count-use
|
|||||||
*/
|
*/
|
||||||
export interface CountUserStatistics {
|
export interface CountUserStatistics {
|
||||||
activeUserHandles: number;
|
activeUserHandles: number;
|
||||||
usesIndexedDB: number;
|
|
||||||
activeUsers: {
|
activeUsers: {
|
||||||
[id: number]: number;
|
[id: number]: number;
|
||||||
};
|
};
|
||||||
@ -52,7 +51,6 @@ export class CountUsersStatisticsService {
|
|||||||
[token, userDataObservable] = this.countUserService.countUsers();
|
[token, userDataObservable] = this.countUserService.countUsers();
|
||||||
this.runningCounts[token] = new BehaviorSubject<CountUserStatistics>({
|
this.runningCounts[token] = new BehaviorSubject<CountUserStatistics>({
|
||||||
activeUserHandles: 0,
|
activeUserHandles: 0,
|
||||||
usesIndexedDB: 0,
|
|
||||||
activeUsers: {},
|
activeUsers: {},
|
||||||
groups: {}
|
groups: {}
|
||||||
});
|
});
|
||||||
@ -66,9 +64,6 @@ export class CountUsersStatisticsService {
|
|||||||
|
|
||||||
// Add to user stats
|
// Add to user stats
|
||||||
stats.activeUserHandles++;
|
stats.activeUserHandles++;
|
||||||
if (data.usesIndexedDB) {
|
|
||||||
stats.usesIndexedDB++;
|
|
||||||
}
|
|
||||||
if (!stats.activeUsers[userId]) {
|
if (!stats.activeUsers[userId]) {
|
||||||
stats.activeUsers[userId] = 0;
|
stats.activeUsers[userId] = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user