mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Broadcast doc usage updates to clients
Summary: Introduces a new message type, docUsage, that's broadcast to all connected clients whenever document usage is updated in ActiveDoc. Test Plan: Browser tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D3451
This commit is contained in:
@@ -6,6 +6,7 @@ import {ActiveDocAPI, ApplyUAOptions, ApplyUAResult} from 'app/common/ActiveDocA
|
||||
import {DocAction, UserAction} from 'app/common/DocActions';
|
||||
import {OpenLocalDocResult} from 'app/common/DocListAPI';
|
||||
import {FilteredDocUsageSummary} from 'app/common/DocUsage';
|
||||
import {Product} from 'app/common/Features';
|
||||
import {docUrl} from 'app/common/urlUtils';
|
||||
import {Events as BackboneEvents} from 'backbone';
|
||||
import {Disposable, Emitter} from 'grainjs';
|
||||
@@ -13,7 +14,6 @@ import {Disposable, Emitter} from 'grainjs';
|
||||
// tslint:disable:no-console
|
||||
|
||||
export interface DocUserAction extends CommMessage {
|
||||
docFD: number;
|
||||
fromSelf?: boolean;
|
||||
data: {
|
||||
docActions: DocAction[];
|
||||
@@ -23,6 +23,13 @@ export interface DocUserAction extends CommMessage {
|
||||
};
|
||||
}
|
||||
|
||||
export interface DocUsageMessage extends CommMessage {
|
||||
data: {
|
||||
docUsage: FilteredDocUsageSummary;
|
||||
product?: Product;
|
||||
};
|
||||
}
|
||||
|
||||
const SLOW_NOTIFICATION_TIMEOUT_MS = 1000; // applies to user actions only
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user