From 94ed955e4141fe35c0ed830f1ada151cdb377bf0 Mon Sep 17 00:00:00 2001 From: dmgnr Date: Sun, 13 Sep 2026 21:42:48 +0700 Subject: [PATCH] feat(don): automatically match and inject artifact uid --- app/(ui)/donate/page.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/(ui)/donate/page.tsx b/app/(ui)/donate/page.tsx index d6560b0..4f65805 100644 --- a/app/(ui)/donate/page.tsx +++ b/app/(ui)/donate/page.tsx @@ -117,6 +117,14 @@ export default async function () { const ph = getPostHogClient(); const distinctId = crypto.randomUUID(); + if ($.message && $.artifact === "false") { + // @ts-expect-error + $.artifact = "true"; + const match = $.message.match(/\b(?:[0-35-9]|18)\d{8}\b/); + // @ts-expect-error + if (match) $.uid = match[0]; + } + return await db.transaction(async (tx): Promise => { if ($.type === "pp") { const arrayBuffer = await $.slip.arrayBuffer();