aboutsummaryrefslogtreecommitdiff
path: root/src/server/websocket.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/websocket.ts')
-rw-r--r--src/server/websocket.ts19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/server/websocket.ts b/src/server/websocket.ts
index d55c2e198..19c98454c 100644
--- a/src/server/websocket.ts
+++ b/src/server/websocket.ts
@@ -221,7 +221,8 @@ export namespace WebSocket {
"script": ["_t", value => value.script.originalScript],
"RichTextField": ["_t", value => value.Text],
"date": ["_d", value => new Date(value.date).toISOString()],
- "proxy": ["_i", "fieldId"],
+ // "proxy": ["_i", "fieldId"],
+ // "proxy": ["", "fieldId"],
"list": ["_l", list => {
const results = [];
for (const value of list.fields) {
@@ -235,25 +236,27 @@ export namespace WebSocket {
};
function ToSearchTerm(val: any): { suffix: string, value: any } | undefined {
+
if (val === null || val === undefined) {
return;
}
const type = val.__type || typeof val;
+
let suffix = suffixMap[type];
if (!suffix) {
return;
}
-
if (Array.isArray(suffix)) {
const accessor = suffix[1];
if (typeof accessor === "function") {
val = accessor(val);
} else {
val = val[accessor];
+
}
suffix = suffix[0];
- }
+ }
return { suffix, value: val };
}
@@ -275,10 +278,18 @@ export namespace WebSocket {
dynfield = true;
const val = docfield[key];
key = key.substring(7);
- Object.values(suffixMap).forEach(suf => update[key + getSuffix(suf)] = { set: null });
+ if (key==="_height"){
+ Object.values(suffixMap).forEach(suf => {update[key] = { set: null };});
+ }
+ else {
+ Object.values(suffixMap).forEach(suf => {update[key + getSuffix(suf)] = { set: null };});
+ }
const term = ToSearchTerm(val);
if (term !== undefined) {
const { suffix, value } = term;
+ if (key==="_height"){
+ update[key] = { set: value };
+ }
update[key + suffix] = { set: value };
}
}