Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(web): trim message in duplicate entry error detection

Richie McIlroyced5ce2ed8b5
diff --git a/apps/web/lib/Notification.ts b/apps/web/lib/Notification.ts
index 3ba4b7970..c71af496a 100644
--- a/apps/web/lib/Notification.ts
+++ b/apps/web/lib/Notification.ts
@@ -46,7 +46,8 @@ const isDuplicateEntryError = (error: unknown) => {
duplicateEntryError.errno !== 1062
)
return false;
- const message = `${duplicateEntryError.sqlMessage ?? ""} ${duplicateEntryError.message ?? ""}`;
+ const message =
+ `${duplicateEntryError.sqlMessage ?? ""} ${duplicateEntryError.message ?? ""}`.trim();
return message.length === 0 || message.includes("dedup_key_idx");
};