fluks / redirect-link

A browser addon to redirect a link to somewhere else.
GNU General Public License v3.0
22 stars 2 forks source link

If you register the same title, only the last item will be reflected #41

Closed kkrrz closed 4 months ago

kkrrz commented 10 months ago

If you enter multiple items with the same title from the settings page, press the save button, and reload the page, only the last item entered will be reflected.

If you can register with the same title, it is convenient because you can switch the "URL" according to "Enable URL" without making the title longer. For example, you can switch the "URL" depending on whether "Enable URL" is https or http.

fluks commented 10 months ago

That's because the redirections are kept in an object with titles as keys, so they will be overwritten if the same title is used.

I don't quite see the need for having the same titles. Maybe you could just add 1, 2, 3 etc. after the title? Only one character longer.

Because moving redirections to an array requires changes and it's not really simple to change I think.

kkrrz commented 10 months ago

I understood. If it is not possible to save the same title, I would like an error message to be displayed when pressing the save button. With the current behavior, if you enter the same title, the entered data will be lost without you noticing.

fluks commented 10 months ago

I will add an error message.

fluks commented 4 months ago

Commit 98b0dbf fixes this.