Plugin follows duplicate behavior behavior of new-entry
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user