From c57cb369f8bd15a274e0a399d84a7f894fa11161 Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 30 Oct 2020 11:35:56 -0400 Subject: fixed setting links from link dialogue in text boxes --- src/fields/Doc.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/fields/Doc.ts') diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index adda40621..c43ec5622 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -92,6 +92,7 @@ export const AclAddonly = Symbol("AclAddonly"); export const AclEdit = Symbol("AclEdit"); export const AclAdmin = Symbol("AclAdmin"); export const UpdatingFromServer = Symbol("UpdatingFromServer"); +export const ForceServerWrite = Symbol("ForceServerWrite"); export const CachedUpdates = Symbol("Cached updates"); const AclMap = new Map([ @@ -185,9 +186,10 @@ export class Doc extends RefField { @observable public [AclSym]: { [key: string]: symbol }; private [UpdatingFromServer]: boolean = false; + private [ForceServerWrite]: boolean = false; private [Update] = (diff: any) => { - !this[UpdatingFromServer] && DocServer.UpdateField(this[Id], diff); + (!this[UpdatingFromServer] || this[ForceServerWrite]) && DocServer.UpdateField(this[Id], diff); } private [Self] = this; -- cgit v1.2.3-70-g09d2 From d1ba2ed3f5e420334b216170199520c26650643d Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 30 Oct 2020 14:58:55 -0400 Subject: trying out action --- src/fields/Doc.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/fields/Doc.ts') diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index c43ec5622..4c3c45d92 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -682,7 +682,7 @@ export namespace Doc { templateLayoutDoc.resolvedDataDoc && (templateLayoutDoc = Cast(templateLayoutDoc.proto, Doc, null) || templateLayoutDoc); // if the template has already been applied (ie, a nested template), then use the template's prototype if (!targetDoc[expandedLayoutFieldKey]) { _pendingMap.set(targetDoc[Id] + expandedLayoutFieldKey + args, true); - setTimeout(() => { + setTimeout(action(() => { const newLayoutDoc = Doc.MakeDelegate(templateLayoutDoc, undefined, "[" + templateLayoutDoc.title + "]"); // the template's arguments are stored in params which is derefenced to find // the actual field key where the parameterized template data is stored. @@ -696,7 +696,7 @@ export namespace Doc { targetDoc[expandedLayoutFieldKey] = newLayoutDoc; _pendingMap.delete(targetDoc[Id] + expandedLayoutFieldKey + args); - }); + })); } } } -- cgit v1.2.3-70-g09d2