@mundogamernetwork/shared-ui 1.17.11 → 1.17.13
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.
|
@@ -31,6 +31,10 @@ const { locale } = useI18n();
|
|
|
31
31
|
|
|
32
32
|
const refDiv = ref<HTMLElement | null>(null);
|
|
33
33
|
const count = ref(0);
|
|
34
|
+
// Auth is restored asynchronously on the client. Rendering the guest menu
|
|
35
|
+
// before that happens makes its absolutely-positioned register link flash at
|
|
36
|
+
// the document corner on authenticated hosts.
|
|
37
|
+
const hydrated = ref(false);
|
|
34
38
|
|
|
35
39
|
const focusOut = (event: MouseEvent) => {
|
|
36
40
|
if (count.value === 0) {
|
|
@@ -42,6 +46,7 @@ const focusOut = (event: MouseEvent) => {
|
|
|
42
46
|
};
|
|
43
47
|
|
|
44
48
|
onMounted(() => {
|
|
49
|
+
hydrated.value = true;
|
|
45
50
|
document.addEventListener("click", focusOut);
|
|
46
51
|
document.addEventListener("keydown", ({ key }) => {
|
|
47
52
|
if (key === "Escape") emit("toggleVisible");
|
|
@@ -114,9 +119,9 @@ const handleToggleOnline = () => {
|
|
|
114
119
|
about; do not "simplify" this back to <div> without re-testing
|
|
115
120
|
the actual guest→signed-in transition, not just a hard reload.
|
|
116
121
|
-->
|
|
117
|
-
<MgLoginRegisterMenu v-if="!signedIn" key="guest" :dropdown="false" />
|
|
122
|
+
<MgLoginRegisterMenu v-if="hydrated && !signedIn" key="guest" :dropdown="false" />
|
|
118
123
|
|
|
119
|
-
<section v-else key="signed-in" class="signed-in-menu">
|
|
124
|
+
<section v-else-if="hydrated" key="signed-in" class="signed-in-menu">
|
|
120
125
|
<div class="row info-row ps-0">
|
|
121
126
|
<div class="col-auto px-3">
|
|
122
127
|
<div v-if="!user?.avatar_url" class="no-avatar-wrapper">
|
|
@@ -165,8 +165,14 @@ onMounted(() => {
|
|
|
165
165
|
top: 0;
|
|
166
166
|
right: 0;
|
|
167
167
|
bottom: 0;
|
|
168
|
+
// The wrapper spans the full viewport height so the open panel can stretch,
|
|
169
|
+
// but when closed only the toggler pill is visible. Without this the empty
|
|
170
|
+
// column above/below it swallowed clicks meant for the header avatar and
|
|
171
|
+
// the bottom-right app banner close button.
|
|
172
|
+
pointer-events: none;
|
|
168
173
|
|
|
169
174
|
.sidebar {
|
|
175
|
+
pointer-events: auto;
|
|
170
176
|
display: inline-flex;
|
|
171
177
|
padding: 12px 24px;
|
|
172
178
|
align-items: center;
|
|
@@ -310,6 +316,7 @@ onMounted(() => {
|
|
|
310
316
|
height: 100vh;
|
|
311
317
|
background-color: rgba(0, 0, 0, 0.5);
|
|
312
318
|
z-index: 35;
|
|
319
|
+
pointer-events: auto;
|
|
313
320
|
border: none;
|
|
314
321
|
display: none;
|
|
315
322
|
}
|
package/package.json
CHANGED
|
@@ -380,7 +380,11 @@ const effectiveKeyItems = computed(() => userKeyItemId.value ?? campaign.value?.
|
|
|
380
380
|
// underneath it.
|
|
381
381
|
const hasPendingObligation = computed(() => {
|
|
382
382
|
const status = effectiveKeyStatus.value
|
|
383
|
-
|
|
383
|
+
// The overdue job may mark a request as `expired` after the material
|
|
384
|
+
// deadline/grace window, but that request can still own a revealed key.
|
|
385
|
+
// Expiration is a warning/access state, not permission to remove the only
|
|
386
|
+
// path for delivering the material.
|
|
387
|
+
return status === 3 || status === 4 || (status === 8 && effectiveKeyItems.value != null)
|
|
384
388
|
})
|
|
385
389
|
|
|
386
390
|
// ------------------------------------------------------------------
|
|
@@ -582,7 +586,11 @@ const currentConfig = computed((): StatusConfig | null => {
|
|
|
582
586
|
|
|
583
587
|
const status = effectiveKeyStatus.value
|
|
584
588
|
const campaignExpired = !hasNoDateLimit.value && parseTimeToExpire(campaign.value?.time_to_expire) <= 0
|
|
585
|
-
|
|
589
|
+
// Older endpoints sometimes serialize this counter as a string and legacy
|
|
590
|
+
// rows can omit it. Normalize it so exhausted campaigns still render their
|
|
591
|
+
// detail/status card instead of being treated as an incomplete payload.
|
|
592
|
+
const availableCount = Number(campaign.value?.available_count ?? 0)
|
|
593
|
+
const campaignExhausted = Number.isFinite(availableCount) && availableCount < 1
|
|
586
594
|
const noRequestYet = status === null || status === undefined || status === 1
|
|
587
595
|
const userCanAccess = campaign.value?.user_can_access !== false
|
|
588
596
|
|
|
@@ -608,6 +616,9 @@ const currentConfig = computed((): StatusConfig | null => {
|
|
|
608
616
|
if (status === 1 && campaignExpired) return statusConfigs.expired
|
|
609
617
|
if (status === 1 && campaignExhausted) return statusConfigs.exhausted
|
|
610
618
|
if (status === 1) return statusConfigs["1"]
|
|
619
|
+
// A request can be marked expired by the overdue ladder after the key was
|
|
620
|
+
// revealed. Keep the material submission action available in that case.
|
|
621
|
+
if (status === 8 && effectiveKeyItems.value != null) return statusConfigs["4"]
|
|
611
622
|
|
|
612
623
|
return statusConfigs[String(status)] || null
|
|
613
624
|
})
|
|
@@ -402,7 +402,10 @@ export const fetchCampaignBySlug = async (slug: string) => {
|
|
|
402
402
|
pr_contact_email: k.supplier_pr?.email ?? null,
|
|
403
403
|
status: k.status,
|
|
404
404
|
quantity: k.quantity,
|
|
405
|
-
|
|
405
|
+
// Keep the shared UI numeric even when an older API serializer returns
|
|
406
|
+
// aggregate counts as strings. Strict comparisons drive the exhausted
|
|
407
|
+
// state in both the list and detail pages.
|
|
408
|
+
available_count: Number.isFinite(Number(k.available_count)) ? Number(k.available_count) : 0,
|
|
406
409
|
streamer_type: k.streamer_type_id,
|
|
407
410
|
streamer_description: k.streamer_type?.description,
|
|
408
411
|
access_tier: k.access_tier ?? "free",
|