Plugin follows duplicate behavior behavior of new-entry

This commit is contained in:
2026-08-28 09:37:14 +02:00
parent 50d61371e1
commit 5696c89dee
14 changed files with 105 additions and 16 deletions
+4 -1
View File
@@ -198,8 +198,11 @@
if (!response.ok) return;
const data = await response.json();
if (data.exists) {
// Re-derive the match locally: browser URL normalization (e.g. trailing slashes) can
// make the server's raw string comparison disagree even when the URLs are equivalent.
const urlMatches = data.url_matches || (data.stored_url && removeKnownTrackingParams(data.stored_url) === url);
let message = 'This link already exists. ';
if (!data.url_matches) {
if (!urlMatches) {
message += 'But, the stored link has a different URL (missing or different parameters).';
message += '\nWhen you save the entry you risk a duplicate entry.';
} else {
+1 -1
View File
@@ -103,6 +103,6 @@
</footer>
<script src="/static/auth-header.js"></script>
<script src="/static/new-entry.js?v=7"></script>
<script src="/static/new-entry.js?v=8"></script>
</body>
</html>