aboutsummaryrefslogtreecommitdiff
path: root/src/fields/Proxy.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/fields/Proxy.ts')
-rw-r--r--src/fields/Proxy.ts8
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;