From 1e5c20010544b12936fbc8dd0bddfb11b947fbd3 Mon Sep 17 00:00:00 2001 From: bob Date: Fri, 15 Feb 2019 12:48:05 -0500 Subject: added logging feedback. fixed some duplicate requests. but it's more broken now. --- src/fields/Document.ts | 8 +++++--- src/fields/ListField.ts | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/fields') diff --git a/src/fields/Document.ts b/src/fields/Document.ts index 4bab1299d..4b159b4eb 100644 --- a/src/fields/Document.ts +++ b/src/fields/Document.ts @@ -4,10 +4,8 @@ import { NumberField } from "./NumberField"; import { ObservableMap, computed, action, observable } from "mobx"; import { TextField } from "./TextField"; import { ListField } from "./ListField"; -import { findDOMNode } from "react-dom"; import { Server } from "../client/Server"; import { Types } from "../server/Message"; -import { ObjectID } from "bson"; export class Document extends Field { public fields: ObservableMap }> = new ObservableMap(); @@ -17,6 +15,8 @@ export class Document extends Field { super(id) if (save) { + var title = (this._proxies.has(KeyStore.Title.Id) ? "???" : this.Title) + "(" + this.Id + ")"; + console.log("Save " + title); Server.UpdateField(this) } } @@ -169,7 +169,9 @@ export class Document extends Field { throw new Error("Method not implemented."); } GetValue() { - throw new Error("Method not implemented."); + var title = (this._proxies.has(KeyStore.Title.Id) ? "???" : this.Title) + "(" + this.Id + ")"; + return title; + //throw new Error("Method not implemented."); } Copy(): Field { throw new Error("Method not implemented."); diff --git a/src/fields/ListField.ts b/src/fields/ListField.ts index 1585746df..d3d8fc71b 100644 --- a/src/fields/ListField.ts +++ b/src/fields/ListField.ts @@ -43,15 +43,17 @@ export class ListField extends BasicField { } init(callback: (field: Field) => any) { + console.log("requesting list fields " + this._proxies.length) Server.GetFields(this._proxies, action((fields: { [index: string]: Field }) => { if (!this.arraysEqual(this._proxies, this.Data.map(field => field.Id))) { - + console.log("Got new fields " + this.Data.length) this.Data = this._proxies.map(id => fields[id] as T) observe(this.Data, () => { this.updateProxies() Server.UpdateField(this); }) } + console.log("received fields " + this.Data) callback(this); })) } -- cgit v1.2.3-70-g09d2