diff options
author | bobzel <zzzman@gmail.com> | 2022-05-25 15:18:46 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-05-25 15:18:46 -0400 |
commit | a01cd55030f549b1c4c207d23731a00e689989c3 (patch) | |
tree | b7aaaf6fecd843a8bbd8122fb8328458f76a456d /src/fields/util.ts | |
parent | 097998abda6857a498f6cfc8a7214a18b09b8451 (diff) |
variety of small fixes for text / sharing. made typed text default to 35 height so that when shared it doesn't start big and jump to small. changed permissions to be private until an Acl is set - this prevents private docs from flicking on momentarily when shared since fields are not distributed atomically. added Shift/Alt/Ctrl Enter for freeform and stacking views to create neighboring docs. fixed first typed char of text to have a user_mark. made shared text doc header overlap to prevent scrolling.
Diffstat (limited to 'src/fields/util.ts')
-rw-r--r-- | src/fields/util.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/fields/util.ts b/src/fields/util.ts index c708affe3..ef5ac79b8 100644 --- a/src/fields/util.ts +++ b/src/fields/util.ts @@ -175,8 +175,11 @@ const getEffectiveAclCache = computedFn(function (target: any, user?: string) { * Calculates the effective access right to a document for the current user. */ export function GetEffectiveAcl(target: any, user?: string): symbol { - return !target ? AclPrivate : - target[UpdatingFromServer] ? AclAdmin : getEffectiveAclCache(target, user);// all changes received from the server must be processed as Admin. return this directly so that the acls aren't cached (UpdatingFromServer is not observable) + if (!target) return AclPrivate; + if (target[UpdatingFromServer]) return AclAdmin; + // authored documents are private until an ACL is set. this also fixes notes that flicker on and off when a remote types to create a private note into a shared collection. + if (!target[AclSym] && target.author && target.author !== Doc.CurrentUserEmail) return AclPrivate; + return getEffectiveAclCache(target, user);// all changes received from the server must be processed as Admin. return this directly so that the acls aren't cached (UpdatingFromServer is not observable) } function getPropAcl(target: any, prop: string | symbol | number) { |