diff options
author | Lionel Han <47760119+IGoByJoe@users.noreply.github.com> | 2020-07-22 20:56:22 -0700 |
---|---|---|
committer | Lionel Han <47760119+IGoByJoe@users.noreply.github.com> | 2020-07-22 20:56:22 -0700 |
commit | efb3fa5fa8081256cfae6ae6cb75b010c560a5e5 (patch) | |
tree | 76aad963de3e1928c89df3dccde85d17d48a3e96 /src/fields/Proxy.ts | |
parent | 5dcc72c2c61e3aafc30b041e312784d881de72d8 (diff) | |
parent | c9703063f1bc4a2007833164bee19c3b0ffb0792 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into new_audio
Diffstat (limited to 'src/fields/Proxy.ts')
-rw-r--r-- | src/fields/Proxy.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fields/Proxy.ts b/src/fields/Proxy.ts index 555faaad0..62734d3d2 100644 --- a/src/fields/Proxy.ts +++ b/src/fields/Proxy.ts @@ -9,7 +9,12 @@ import { Id, Copy, ToScriptString, ToString } from "./FieldSymbols"; import { scriptingGlobal } from "../client/util/Scripting"; import { Plugins } from "./util"; -@Deserializable("proxy") +function deserializeProxy(field: any) { + if (!field.cache) { + field.cache = DocServer.GetCachedRefField(field.fieldId) as any; + } +} +@Deserializable("proxy", deserializeProxy) export class ProxyField<T extends RefField> extends ObjectField { constructor(); constructor(value: T); @@ -17,6 +22,7 @@ export class ProxyField<T extends RefField> extends ObjectField { constructor(value?: T | string) { super(); if (typeof value === "string") { + this.cache = DocServer.GetCachedRefField(value) as any; this.fieldId = value; } else if (value) { this.cache = value; |