diff --git a/app/client/ui/DocMenu.ts b/app/client/ui/DocMenu.ts index 86bc85f8..19a36b5a 100644 --- a/app/client/ui/DocMenu.ts +++ b/app/client/ui/DocMenu.ts @@ -134,7 +134,7 @@ function createLoadedDocMenu(owner: IDisposableOwner, home: HomeModel) { hasFeaturedTemplates ? t("More Examples and Templates") : t("Examples and Templates") ) : page === 'trash' ? t("Trash") : - workspace && [css.docHeaderIcon(workspace.shareType === 'private' ? 'FolderPrivate' : 'Folder'), workspaceName(home.app, workspace)] + workspace && [css.docHeaderIcon(workspace.shareType === 'public' ? 'Folder' : 'FolderPrivate'), workspaceName(home.app, workspace)] ), testId('doc-header'), ) @@ -198,8 +198,7 @@ function buildAllDocsBlock( if (showIntro) { return null; } return css.docBlock( css.docBlockHeaderLink( - css.wsLeft( - css.wsLeft(css.docHeaderIcon(ws.shareType === 'private' ? 'FolderPrivate' : 'Folder'), + css.wsLeft(css.docHeaderIcon(ws.shareType === 'public' ? 'Folder' : 'FolderPrivate'), workspaceName(home.app, ws), ), @@ -276,7 +275,7 @@ function buildAllTemplates(home: HomeModel, templateWorkspaces: Observable, home: Hom // TODO: Introduce a "SwitchSelector" pattern to avoid the need for N computeds (and N // recalculations) to select one of N items. const isRenaming = computed((use) => use(renaming) === ws); - const iconName = ws.shareType === 'private' ? 'FolderPrivate' : 'Folder'; + const iconName = ws.shareType === 'public' ? 'Folder' : 'FolderPrivate'; return cssPageEntry( dom.autoDispose(isRenaming), dom.autoDispose(isTrivial), diff --git a/app/gen-server/lib/homedb/HomeDBManager.ts b/app/gen-server/lib/homedb/HomeDBManager.ts index 8ea63ab9..3879d912 100644 --- a/app/gen-server/lib/homedb/HomeDBManager.ts +++ b/app/gen-server/lib/homedb/HomeDBManager.ts @@ -703,9 +703,9 @@ export class HomeDBManager extends EventEmitter { roles.getWeakestRole(user.parentAccess, maxInheritedRole)); }); if (permissionDataUsers?.length > 1) { - ws.shareType = permissionDataUsers.find((user) => user.email !== EVERYONE_EMAIL && user.email !== ANONYMOUS_USER_EMAIL && user.id === scope.userId) - ? 'private' - : 'public'; + ws.shareType = permissionDataUsers.find((user) => user.email === EVERYONE_EMAIL || user.email === ANONYMOUS_USER_EMAIL || user.id !== scope.userId) + ? 'public' + : 'private'; for(const doc of ws.docs) { const permissionDataUsersDoc = this.unwrapQueryResult(