From d1416451deaa5c24ea719b83ab4f769129874eb0 Mon Sep 17 00:00:00 2001 From: Enjeck C Date: Mon, 6 Oct 2025 19:13:53 +0100 Subject: [PATCH 1/2] fix: Avoid duplicate navigation items Signed-off-by: Enjeck C --- src/store/store.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/store/store.js b/src/store/store.js index 5376fdd18e..ef4ebc6308 100644 --- a/src/store/store.js +++ b/src/store/store.js @@ -105,10 +105,24 @@ export const useTablesStore = defineStore('store', { } }, setTables(tables) { - this.tables = tables + // Deduplicate tables by ID to prevent navigation duplication + const uniqueTables = tables.reduce((acc, table) => { + if (!acc.find(t => t.id === table.id)) { + acc.push(table) + } + return acc + }, []) + this.tables = uniqueTables }, setViews(views) { - this.views = views + // Deduplicate views by ID to prevent navigation duplication + const uniqueViews = views.reduce((acc, view) => { + if (!acc.find(v => v.id === view.id)) { + acc.push(view) + } + return acc + }, []) + this.views = uniqueViews }, setTemplates(templates) { this.templates = templates From f53c662e863c331729ac3ad6db37e0d20b78bbc3 Mon Sep 17 00:00:00 2001 From: Enjeck C Date: Thu, 9 Oct 2025 08:34:14 +0100 Subject: [PATCH 2/2] fix: Parse table and view id as int Signed-off-by: Enjeck C --- src/store/store.js | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/store/store.js b/src/store/store.js index ef4ebc6308..bfadca4630 100644 --- a/src/store/store.js +++ b/src/store/store.js @@ -105,24 +105,10 @@ export const useTablesStore = defineStore('store', { } }, setTables(tables) { - // Deduplicate tables by ID to prevent navigation duplication - const uniqueTables = tables.reduce((acc, table) => { - if (!acc.find(t => t.id === table.id)) { - acc.push(table) - } - return acc - }, []) - this.tables = uniqueTables + this.tables = tables }, setViews(views) { - // Deduplicate views by ID to prevent navigation duplication - const uniqueViews = views.reduce((acc, view) => { - if (!acc.find(v => v.id === view.id)) { - acc.push(view) - } - return acc - }, []) - this.views = uniqueViews + this.views = views }, setTemplates(templates) { this.templates = templates @@ -508,6 +494,7 @@ export const useTablesStore = defineStore('store', { }, async loadContextTable({ id }) { + id = parseInt(id) const table = this.tables.find(table => table.id === id) if (table) { return true @@ -530,6 +517,7 @@ export const useTablesStore = defineStore('store', { }, async loadContextView({ id }) { + id = parseInt(id) const view = this.views.find(view => view.id === id) if (view) { return true