@burdenoff/website-sdk 2026.829.6 → 2026.829.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3391,6 +3391,7 @@ function ExplorePage({
3391
3391
  const fileInputRef = React.useRef(null);
3392
3392
  const stagedRef = React.useRef([]);
3393
3393
  stagedRef.current = staged;
3394
+ const pickQueueRef = React.useRef(Promise.resolve());
3394
3395
  const [shareLabel, setShareLabel] = React.useState("Share");
3395
3396
  const [shareUrl, setShareUrl] = React.useState(null);
3396
3397
  const scrollRef = React.useRef(null);
@@ -3456,35 +3457,42 @@ function ExplorePage({
3456
3457
  setTimeout(() => setShareLabel("Share"), 2500);
3457
3458
  return;
3458
3459
  }
3459
- const base = (pageUrl ?? window.location.href).split("?")[0];
3460
- const url = `${base}?c=${encodeURIComponent(token)}`;
3460
+ const url = new URL(pageUrl ?? window.location.href);
3461
+ url.search = "";
3462
+ url.hash = "";
3463
+ url.searchParams.set("c", token);
3464
+ const shareable = url.toString();
3461
3465
  try {
3462
- await navigator.clipboard.writeText(url);
3466
+ await navigator.clipboard.writeText(shareable);
3463
3467
  setShareLabel("Copied");
3464
3468
  setTimeout(() => setShareLabel("Share"), 2500);
3465
3469
  } catch {
3466
- setShareUrl(url);
3470
+ setShareUrl(shareable);
3467
3471
  setShareLabel("Share");
3468
3472
  }
3469
3473
  }, [createShareLink, pageUrl]);
3470
3474
  const handleFilesPicked = React.useCallback(
3471
- async (picked) => {
3472
- if (!picked || picked.length === 0) return;
3473
- const { accepted, rejected } = await stageFiles(
3474
- Array.from(picked),
3475
- stagedRef.current
3476
- );
3477
- setStaged((prev) => [...prev, ...accepted]);
3478
- const first = rejected[0];
3479
- setAttachmentNotice(
3480
- first ? first.reason === "too-large" ? fill(T.attachmentTooLarge, {
3481
- name: first.name,
3482
- size: String(MAX_ATTACHMENT_BYTES / (1024 * 1024))
3483
- }) : fill(T.attachmentTooMany, {
3484
- name: first.name,
3485
- max: String(MAX_ATTACHMENTS)
3486
- }) : null
3487
- );
3475
+ (picked) => {
3476
+ if (!picked || picked.length === 0) return pickQueueRef.current;
3477
+ const files = Array.from(picked);
3478
+ pickQueueRef.current = pickQueueRef.current.then(async () => {
3479
+ const { accepted, rejected } = await stageFiles(
3480
+ files,
3481
+ stagedRef.current
3482
+ );
3483
+ setStaged((prev) => [...prev, ...accepted]);
3484
+ const first = rejected[0];
3485
+ setAttachmentNotice(
3486
+ first ? first.reason === "too-large" ? fill(T.attachmentTooLarge, {
3487
+ name: first.name,
3488
+ size: String(MAX_ATTACHMENT_BYTES / (1024 * 1024))
3489
+ }) : fill(T.attachmentTooMany, {
3490
+ name: first.name,
3491
+ max: String(MAX_ATTACHMENTS)
3492
+ }) : null
3493
+ );
3494
+ });
3495
+ return pickQueueRef.current;
3488
3496
  },
3489
3497
  [T]
3490
3498
  );