Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Fix default category in view selection

Smaug6739f4c9781c62ac
diff --git a/frontend/app/components/Node/NodeList.vue b/frontend/app/components/Node/NodeList.vue
index 4ed6bfe6..b818363a 100644
--- a/frontend/app/components/Node/NodeList.vue
+++ b/frontend/app/components/Node/NodeList.vue
@@ -108,12 +108,6 @@ watch(
{ immediate: true },
);
-onMounted(() => {
- const storedView = localStorage.getItem('viewSelection');
- if (storedView && ['table', 'list', 'kanban'].includes(storedView)) view.value = storedView as ViewMode;
- else view.value = 'table';
-});
-
const openPermissionsModal = () => {
if (props.parent) useModal().add(new Modal(shallowRef(NodePermissions), { props: { node: props.parent }, size: 'small' }));
};
diff --git a/frontend/app/components/ViewSelection.vue b/frontend/app/components/ViewSelection.vue
index 416b3182..51c97c7b 100644
--- a/frontend/app/components/ViewSelection.vue
+++ b/frontend/app/components/ViewSelection.vue
@@ -34,6 +34,14 @@ const viewOptions = computed(() => {
watch(view, newView => {
if (newView) localStorage.setItem('viewSelection', newView);
});
+
+onMounted(() => {
+ const storedView = localStorage.getItem('viewSelection');
+ const list = ['table', 'list'];
+ if (props.showKanban) list.push('kanban');
+ if (storedView && list.includes(storedView)) view.value = storedView as ViewMode;
+ else view.value = 'table';
+});
</script>
<style scoped lang="scss">