aboutsummaryrefslogtreecommitdiff
path: root/src/client/Server.ts
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-04-13 19:39:37 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-04-13 19:39:37 -0400
commitd6fd8338a440085c1ba865c4771c0871208e961e (patch)
tree3839b2fb83579b755ba02062079a288ad52d3bb5 /src/client/Server.ts
parenta23b160d19beff9163f970f7ae678c2aed9ce14e (diff)
cleaning up network data transfer.
Diffstat (limited to 'src/client/Server.ts')
-rw-r--r--src/client/Server.ts20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/client/Server.ts b/src/client/Server.ts
index 3bbbebe72..66e9878d9 100644
--- a/src/client/Server.ts
+++ b/src/client/Server.ts
@@ -12,7 +12,6 @@ export class Server {
static Socket: SocketIOClient.Socket = OpenSocket(`${window.location.protocol}//${window.location.hostname}:4321`);
static GUID: string = Utils.GenerateGuid();
-
// Retrieves the cached value of the field and sends a request to the server for the real value (if it's not cached).
// Call this is from within a reaction and test whether the return value is FieldWaiting.
public static GetField(fieldid: FieldId): Promise<Opt<Field>>;
@@ -127,13 +126,6 @@ export class Server {
}
}
- public static AddDocument(document: Document) {
- SocketStub.SEND_ADD_DOCUMENT(document);
- }
- public static AddDocumentField(doc: Document, key: Key, value: Field) {
- console.log("Add doc field " + doc.Title + " " + key.Name + " fid " + value.Id + " " + value);
- SocketStub.SEND_ADD_DOCUMENT_FIELD(doc, key, value);
- }
public static DeleteDocumentField(doc: Document, key: Key) {
SocketStub.SEND_DELETE_DOCUMENT_FIELD(doc, key);
}
@@ -161,18 +153,18 @@ export class Server {
}
@action
- static updateField(field: { _id: string, data: any, type: Types }) {
- if (Server.ClientFieldsCached.has(field._id)) {
- var f = Server.ClientFieldsCached.get(field._id);
+ static updateField(field: { id: string, data: any, type: Types }) {
+ if (Server.ClientFieldsCached.has(field.id)) {
+ var f = Server.ClientFieldsCached.get(field.id);
if (f) {
- // console.log("Applying : " + field._id);
+ // console.log("Applying : " + field.id);
f.UpdateFromServer(field.data);
f.init(emptyFunction);
} else {
- // console.log("Not applying wa : " + field._id);
+ // console.log("Not applying wa : " + field.id);
}
} else {
- // console.log("Not applying mi : " + field._id);
+ // console.log("Not applying mi : " + field.id);
}
}
}