aboutsummaryrefslogtreecommitdiff
path: root/src/client/DocServer.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/DocServer.ts')
-rw-r--r--src/client/DocServer.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts
index 33fa928f2..c644308b7 100644
--- a/src/client/DocServer.ts
+++ b/src/client/DocServer.ts
@@ -34,7 +34,7 @@ export namespace DocServer {
throw new Error("Can't use DocServer without calling init first");
}
let _UpdateField: (id: string, diff: serverOpType) => void = errorFunc;
- let _CreateField: (field: Doc) => void = errorFunc;
+ let _CreateDocField: (field: Doc) => void = errorFunc;
export function AddServerHandler<T>(socket: Socket, message: Message<T>, handler: (args: T) => void) {
socket.on(message.Message, Utils.loggingCallback('Incoming', handler, message.Name));
@@ -132,7 +132,7 @@ export namespace DocServer {
export function makeReadOnly() {
if (!_isReadOnly) {
_isReadOnly = true;
- _CreateField = field => {
+ _CreateDocField = field => {
_cache[field[Id]] = field;
};
_UpdateField = emptyFunction;
@@ -357,20 +357,20 @@ export namespace DocServer {
}
/**
- * A wrapper around the function local variable _createField.
+ * A wrapper around the function local variable _CreateDocField.
* This allows us to swap in different executions while comfortably
* calling the same function throughout the code base (such as in Util.makeReadonly())
* @param field the [RefField] to be serialized and sent to the server to be stored in the database
*/
- export function CreateField(field: Doc) {
+ export function CreateDocField(field: Doc) {
_cacheNeedsUpdate = true;
- _CreateField(field);
+ _CreateDocField(field);
}
- function _CreateFieldImpl(field: Doc) {
+ function _CreateDocFieldImpl(field: Doc) {
_cache[field[Id]] = field;
const initialState = SerializationHelper.Serialize(field);
- ClientUtils.CurrentUserEmail() !== 'guest' && DocServer.Emit(_socket, MessageStore.CreateField, initialState);
+ ClientUtils.CurrentUserEmail() !== 'guest' && DocServer.Emit(_socket, MessageStore.CreateDocField, initialState);
}
// NOTIFY THE SERVER OF AN UPDATE TO A DOC'S STATE
@@ -462,7 +462,7 @@ export namespace DocServer {
_GetCachedRefField = _GetCachedRefFieldImpl;
SetObjGetRefField((_GetRefField = _GetRefFieldImpl));
SetObjGetRefFields((_GetRefFields = _GetRefFieldsImpl));
- _CreateField = _CreateFieldImpl;
+ _CreateDocField = _CreateDocFieldImpl;
_UpdateField = _UpdateFieldImpl;
/**