@mundogamernetwork/shared-ui 1.17.12 → 1.17.14
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">
|
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
|
})
|
|
@@ -407,6 +407,12 @@ const requestUrl = useRequestURL();
|
|
|
407
407
|
const seoTitle = computed(() => kit.value ? `${kit.value.name} — Mundo Gamer Press Kit` : 'Mundo Gamer Press Kit');
|
|
408
408
|
const seoDescription = computed(() => kit.value?.tagline || kit.value?.description?.replace(/<[^>]*>/g, '').slice(0, 160) || '');
|
|
409
409
|
const seoImage = computed(() => kit.value?.hero_image_url || kit.value?.cover_image_url || kit.value?.logo_url || '');
|
|
410
|
+
const seoImageType = computed(() => {
|
|
411
|
+
const image = seoImage.value.toLowerCase();
|
|
412
|
+
if (image.includes('.png')) return 'image/png';
|
|
413
|
+
if (image.includes('.webp')) return 'image/webp';
|
|
414
|
+
return 'image/jpeg';
|
|
415
|
+
});
|
|
410
416
|
|
|
411
417
|
// Raw useHead meta-array form, not useSeoMeta — see the matching comment in
|
|
412
418
|
// shared-ui/pages/mural/[slug]/index.vue for why (useSeoMeta's og:*/twitter:*/
|
|
@@ -426,6 +432,10 @@ useHead(() => ({
|
|
|
426
432
|
// Only override the image when the kit actually has one — an empty
|
|
427
433
|
// string would replace (not fall back to) the site default image.
|
|
428
434
|
...(seoImage.value ? [{ property: 'og:image', content: seoImage.value }] : []),
|
|
435
|
+
...(seoImage.value ? [
|
|
436
|
+
{ property: 'og:image:secure_url', content: seoImage.value },
|
|
437
|
+
{ property: 'og:image:type', content: seoImageType.value },
|
|
438
|
+
] : []),
|
|
429
439
|
{ property: 'og:type', content: 'article' },
|
|
430
440
|
{ property: 'og:url', content: requestUrl.href },
|
|
431
441
|
{ property: 'og:site_name', content: 'Mundo Gamer Press Kit' },
|
|
@@ -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",
|