From 718070e6a627305cfff7575797e8eb4abb93714a Mon Sep 17 00:00:00 2001 From: Tyler Schicke Date: Wed, 1 May 2019 18:40:10 -0400 Subject: Fixed most of video annotations --- src/client/DocServer.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/client/DocServer.ts') diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts index 1d73abd1f..8e9f7865b 100644 --- a/src/client/DocServer.ts +++ b/src/client/DocServer.ts @@ -22,8 +22,8 @@ export namespace DocServer { let cached = _cache[id]; if (cached === undefined) { const prom = Utils.EmitCallback(_socket, MessageStore.GetRefField, id).then(fieldJson => { - const field = fieldJson === undefined ? fieldJson : SerializationHelper.Deserialize(fieldJson); - if (field) { + const field = SerializationHelper.Deserialize(fieldJson); + if (field !== undefined) { _cache[id] = field; } else { delete _cache[id]; @@ -58,7 +58,7 @@ export namespace DocServer { const prom = Utils.EmitCallback(_socket, MessageStore.GetRefFields, requestedIds).then(fields => { const fieldMap: { [id: string]: RefField } = {}; for (const field of fields) { - if (field) { + if (field !== undefined) { fieldMap[field.id] = SerializationHelper.Deserialize(field); } } @@ -68,7 +68,7 @@ export namespace DocServer { const fields = await prom; requestedIds.forEach(id => { const field = fields[id]; - if (field) { + if (field !== undefined) { _cache[id] = field; } else { delete _cache[id]; -- cgit v1.2.3-70-g09d2