mirror of
https://github.com/colanode/colanode.git
synced 2025-12-16 19:57:46 +01:00
Fix radar service for new node counter updates
This commit is contained in:
@@ -28,6 +28,17 @@ export class AccountMetadataListQueryHandler
|
|||||||
if (
|
if (
|
||||||
event.type === 'account_created' &&
|
event.type === 'account_created' &&
|
||||||
event.account.id === input.accountId
|
event.account.id === input.accountId
|
||||||
|
) {
|
||||||
|
const result = await this.handleQuery(input);
|
||||||
|
return {
|
||||||
|
hasChanges: true,
|
||||||
|
result,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
event.type === 'account_deleted' &&
|
||||||
|
event.account.id === input.accountId
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
hasChanges: true,
|
hasChanges: true,
|
||||||
|
|||||||
@@ -33,6 +33,18 @@ export class WorkspaceMetadataListQueryHandler
|
|||||||
event.type === 'workspace_created' &&
|
event.type === 'workspace_created' &&
|
||||||
event.workspace.accountId === input.accountId &&
|
event.workspace.accountId === input.accountId &&
|
||||||
event.workspace.id === input.workspaceId
|
event.workspace.id === input.workspaceId
|
||||||
|
) {
|
||||||
|
const result = await this.handleQuery(input);
|
||||||
|
return {
|
||||||
|
hasChanges: true,
|
||||||
|
result,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
event.type === 'workspace_deleted' &&
|
||||||
|
event.workspace.accountId === input.accountId &&
|
||||||
|
event.workspace.id === input.workspaceId
|
||||||
) {
|
) {
|
||||||
return {
|
return {
|
||||||
hasChanges: true,
|
hasChanges: true,
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ export class RadarService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this.counters.has(event.counter.nodeId)) {
|
if (!this.counters.has(event.counter.nodeId)) {
|
||||||
return;
|
this.counters.set(event.counter.nodeId, new Map());
|
||||||
}
|
}
|
||||||
|
|
||||||
const nodeCounters = this.counters.get(event.counter.nodeId);
|
const nodeCounters = this.counters.get(event.counter.nodeId);
|
||||||
|
|||||||
Reference in New Issue
Block a user