π The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.
Vue dockergolangkanbanknowledge-baseknowledge-managementmarkdownnote-takingnotesnotes-appnotionnuxtnuxtjsoffline-firstoidcpwaselfhostedssovuevuejswiki
Fix icon file parent generation
Smaug6739967160f87a68
diff --git a/frontend/app/components/Sidebar/SidebarItem.vue b/frontend/app/components/Sidebar/SidebarItem.vueindex db16d5d5..ae85c203 100644--- a/frontend/app/components/Sidebar/SidebarItem.vue+++ b/frontend/app/components/Sidebar/SidebarItem.vue@@ -42,7 +42,7 @@ const customClass = computed(() => {return 'default-icon';});const icon = computed(() => {- if (props.item.data.icon) return props.item.data.icon;+ if (props.item.icon === 'file' && props.item.childrens?.length) return 'file_parent';return props.item.icon || '';});diff --git a/frontend/app/composables/useNodesTree.ts b/frontend/app/composables/useNodesTree.tsindex edbf00b5..5a73c375 100644--- a/frontend/app/composables/useNodesTree.ts+++ b/frontend/app/composables/useNodesTree.ts@@ -2,15 +2,11 @@ import type { Node } from '~/stores';let nodes: ComputedRef<Item<Node>[]> | Ref<Item<Node>[]> = ref([]);const structure = computed(() => new TreeStructure(nodes.value));-const preferences = usePreferences();const resolveIcon = (item: Node) => {if (item.role === 1) return item.icon || 'workspace';if (item.role === 2) return item.icon || (item.shared ? 'shared_folder' : 'folder');- if (item.role === 3) {- if (!preferences.get('normalizeFileIcons').value && structure.value.childrenMap.get(item.id)?.length) return 'file_parent';- return item.accessibility == 1 ? 'file' : item.accessibility == 2 ? 'draft' : 'shared_doc';- }+ if (item.role === 3) return item.accessibility == 1 ? 'file' : item.accessibility == 2 ? 'draft' : 'shared_doc';if (item.role === 4) return item.metadata?.filetype == 'application/pdf' ? 'pdf' : 'image';return 'file';};@@ -47,7 +43,7 @@ function useSidebarTree() {parent_id: node.role !== 1 ? node.parent_id || '' : '',label: node.name,route: resolveLink(node),- icon: resolveIcon(node),+ icon: ref(resolveIcon(node)).value,data: node,show: ref(getCollapseState(node.id)),}))