@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.
@@ -3365,6 +3365,7 @@ function ExplorePage({
3365
3365
  const fileInputRef = useRef(null);
3366
3366
  const stagedRef = useRef([]);
3367
3367
  stagedRef.current = staged;
3368
+ const pickQueueRef = useRef(Promise.resolve());
3368
3369
  const [shareLabel, setShareLabel] = useState("Share");
3369
3370
  const [shareUrl, setShareUrl] = useState(null);
3370
3371
  const scrollRef = useRef(null);
@@ -3430,35 +3431,42 @@ function ExplorePage({
3430
3431
  setTimeout(() => setShareLabel("Share"), 2500);
3431
3432
  return;
3432
3433
  }
3433
- const base = (pageUrl ?? window.location.href).split("?")[0];
3434
- const url = `${base}?c=${encodeURIComponent(token)}`;
3434
+ const url = new URL(pageUrl ?? window.location.href);
3435
+ url.search = "";
3436
+ url.hash = "";
3437
+ url.searchParams.set("c", token);
3438
+ const shareable = url.toString();
3435
3439
  try {
3436
- await navigator.clipboard.writeText(url);
3440
+ await navigator.clipboard.writeText(shareable);
3437
3441
  setShareLabel("Copied");
3438
3442
  setTimeout(() => setShareLabel("Share"), 2500);
3439
3443
  } catch {
3440
- setShareUrl(url);
3444
+ setShareUrl(shareable);
3441
3445
  setShareLabel("Share");
3442
3446
  }
3443
3447
  }, [createShareLink, pageUrl]);
3444
3448
  const handleFilesPicked = useCallback(
3445
- async (picked) => {
3446
- if (!picked || picked.length === 0) return;
3447
- const { accepted, rejected } = await stageFiles(
3448
- Array.from(picked),
3449
- stagedRef.current
3450
- );
3451
- setStaged((prev) => [...prev, ...accepted]);
3452
- const first = rejected[0];
3453
- setAttachmentNotice(
3454
- first ? first.reason === "too-large" ? fill(T.attachmentTooLarge, {
3455
- name: first.name,
3456
- size: String(MAX_ATTACHMENT_BYTES / (1024 * 1024))
3457
- }) : fill(T.attachmentTooMany, {
3458
- name: first.name,
3459
- max: String(MAX_ATTACHMENTS)
3460
- }) : null
3461
- );
3449
+ (picked) => {
3450
+ if (!picked || picked.length === 0) return pickQueueRef.current;
3451
+ const files = Array.from(picked);
3452
+ pickQueueRef.current = pickQueueRef.current.then(async () => {
3453
+ const { accepted, rejected } = await stageFiles(
3454
+ files,
3455
+ stagedRef.current
3456
+ );
3457
+ setStaged((prev) => [...prev, ...accepted]);
3458
+ const first = rejected[0];
3459
+ setAttachmentNotice(
3460
+ first ? first.reason === "too-large" ? fill(T.attachmentTooLarge, {
3461
+ name: first.name,
3462
+ size: String(MAX_ATTACHMENT_BYTES / (1024 * 1024))
3463
+ }) : fill(T.attachmentTooMany, {
3464
+ name: first.name,
3465
+ max: String(MAX_ATTACHMENTS)
3466
+ }) : null
3467
+ );
3468
+ });
3469
+ return pickQueueRef.current;
3462
3470
  },
3463
3471
  [T]
3464
3472
  );