This commit is contained in:
arussac
2026-05-31 15:35:59 +02:00
parent 48a99514b2
commit d88b71b2c6
11 changed files with 227 additions and 31 deletions

View File

@@ -81,6 +81,16 @@ export function useShop() {
return entitlements.value.filter((e) => e.kind === 'pet' && e.active).length;
}
function ownedPetChars(): string[] {
return entitlements.value
.filter((e) => e.kind === 'pet' && e.active)
.map((e) => {
try { return (JSON.parse(e.metaJson ?? '{}') as any).char ?? ''; }
catch { return ''; }
})
.filter(Boolean);
}
async function purchase(productId: string, options: PurchaseOptions = {}): Promise<boolean> {
buying.value = productId;
lastError.value = null;
@@ -119,6 +129,7 @@ export function useShop() {
fetchMe,
owns,
petCount,
ownedPetChars,
purchase,
};
}