Wire shop UI to RPCs and auto-equip after purchase.

Refactor client storage to call Supabase RPCs and equip items immediately after a successful buy.
This commit is contained in:
2026-05-24 04:02:56 -06:00
parent f02208c0ea
commit 5fefc65412
3 changed files with 533 additions and 118 deletions

View File

@@ -147,7 +147,8 @@ export function ShopContent() {
try {
const item = await purchaseShopItem(itemId);
toast(`Purchased ${item.name}.`, "success");
await equipShopItem(itemId);
toast(`Purchased and equipped ${item.name}.`, "success");
await refreshShop();
} catch (purchaseError) {
toast(