From 2eb147ab8f25e6dd90f47cf21499c7340642f0c9 Mon Sep 17 00:00:00 2001 From: yipstanley Date: Mon, 11 Feb 2019 20:38:09 -0500 Subject: asdkjfl --- src/fields/Document.ts | 10 +++++----- src/fields/Field.ts | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src/fields') diff --git a/src/fields/Document.ts b/src/fields/Document.ts index 004bfa4c0..99cd03813 100644 --- a/src/fields/Document.ts +++ b/src/fields/Document.ts @@ -10,7 +10,7 @@ import { Types } from "../server/Message"; export class Document extends Field { public fields: ObservableMap> = new ObservableMap(); - public _proxies: ObservableMap = new ObservableMap(); + public _proxies: ObservableMap = new ObservableMap(); @computed public get Title() { @@ -22,18 +22,18 @@ export class Document extends Field { if (ignoreProto) { if (this.fields.has(key)) { field = this.fields.get(key); - } else if (this._proxies.has(key)) { + } else if (this._proxies.has(key.Id)) { field = Server.GetDocumentField(this, key); } } else { let doc: FieldValue = this; while (doc && doc != FieldWaiting && field != FieldWaiting) { if (!doc.fields.has(key)) { - if (doc._proxies.has(key)) { + if (doc._proxies.has(key.Id)) { field = Server.GetDocumentField(doc, key); break; } - if ((doc.fields.has(KeyStore.Prototype) || doc._proxies.has(KeyStore.Prototype))) { + if ((doc.fields.has(KeyStore.Prototype) || doc._proxies.has(KeyStore.Prototype.Id))) { doc = doc.GetPrototype(); } else break; @@ -160,7 +160,7 @@ export class Document extends Field { let fields: [string, string][] = [] this._proxies.forEach((field, key) => { if (field) { - fields.push([key.Id as string, field as string]) + fields.push([key, field as string]) } }); diff --git a/src/fields/Field.ts b/src/fields/Field.ts index 03c2da7be..1a5cfb29c 100644 --- a/src/fields/Field.ts +++ b/src/fields/Field.ts @@ -28,8 +28,8 @@ export type FieldValue = Opt | FIELD_WAITING; export abstract class Field { //FieldUpdated: TypedEvent> = new TypedEvent>(); - private id: FIELD_ID; - get Id(): FIELD_ID { + private id: string; + get Id(): string { return this.id; } @@ -87,6 +87,7 @@ export abstract class Field { let doc: Document = new Document(id) let fields: [string, string][] = data as [string, string][] fields.forEach(element => { + doc._proxies.set(element[0], element[1]); let keyId: string = element[0] let valueId: string = element[1] Server.GetField(keyId, (key: Field) => { -- cgit v1.2.3-70-g09d2