Skip to content

fix: Avoid duplicate navigation items - #2094

Merged
enjeck merged 2 commits into
mainfrom
avoid-duplicate-nav-item
Oct 11, 2025
Merged

fix: Avoid duplicate navigation items#2094
enjeck merged 2 commits into
mainfrom
avoid-duplicate-nav-item

Conversation

@enjeck

@enjeck enjeck commented Oct 6, 2025

Copy link
Copy Markdown
Contributor

To reproduce problem:

This PR fixes it by just removing duplicate entries in the store

@enjeck enjeck self-assigned this Oct 6, 2025
@enjeck
enjeck requested a review from blizzz as a code owner October 6, 2025 18:16
@enjeck enjeck added the 3. to review Waiting for reviews label Oct 6, 2025
@github-project-automation github-project-automation Bot moved this to 馃Л Planning evaluation (don't pick) in 馃摑 Productivity team Oct 6, 2025
@blizzz

blizzz commented Oct 6, 2025

Copy link
Copy Markdown
Member

Is there a reason why/place where we try to set duplicate tables in first place?

@jancborchardt jancborchardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran into this last week as well. Didn鈥檛 test, but thanks for fixing it!

@benjaminfrueh

Copy link
Copy Markdown
Contributor

Hi @enjeck and @blizzz
I just ran into this issue too when implementing a new feature, so I decided to look into it quickly.

The issue is caused in the store.js, in the functions loadContextTable() and loadContextView().
These functions try to select a table or view first, and then return if the view or table was found.

const view = this.views.find(view => view.id === id)
if (view) {
    return true
}

The issue is, on page reload, the variable id is a string, not a integer anymore, so it is not able to find the view and duplicates it here with tables.push() and views.push().

I have not looked into why this happens yet or what change caused it, but this duplication could be prevented by making sure the id for searching a view or table is a integer, with e. g. parseInt().

@benjaminfrueh
benjaminfrueh self-requested a review October 7, 2025 20:18
@enjeck

enjeck commented Oct 9, 2025

Copy link
Copy Markdown
Contributor Author

Hi @enjeck and @blizzz I just ran into this issue too when implementing a new feature, so I decided to look into it quickly.

The issue is caused in the store.js, in the functions loadContextTable() and loadContextView(). These functions try to select a table or view first, and then return if the view or table was found.

const view = this.views.find(view => view.id === id)
if (view) {
    return true
}

The issue is, on page reload, the variable id is a string, not a integer anymore, so it is not able to find the view and duplicates it here with tables.push() and views.push().

I have not looked into why this happens yet or what change caused it, but this duplication could be prevented by making sure the id for searching a view or table is a integer, with e. g. parseInt().

Simpler fix, thanks!

enjeck added 2 commits October 9, 2025 08:35
Signed-off-by: Enjeck C <patrathewhiz@gmail.com>
Signed-off-by: Enjeck C <patrathewhiz@gmail.com>
@enjeck
enjeck force-pushed the avoid-duplicate-nav-item branch from c8e87c3 to f53c662 Compare October 9, 2025 07:35
@enjeck
enjeck merged commit 90f1c75 into main Oct 11, 2025
50 of 53 checks passed
@enjeck
enjeck deleted the avoid-duplicate-nav-item branch October 11, 2025 17:03
@github-project-automation github-project-automation Bot moved this from 馃Л Planning evaluation (don't pick) to 鈽戯笍 Done in 馃摑 Productivity team Oct 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants