MCPcopy Create free account
hub / github.com/AmazingAng/PolyWorld / saveRecentOrder

Function saveRecentOrder

src/components/TradeModal.tsx:59–65  ·  view source on GitHub ↗
(order: RecentOrder)

Source from the content-addressed store, hash-verified

57 } catch { return []; }
58}
59function saveRecentOrder(order: RecentOrder) {
60 try {
61 const existing = loadRecentOrders();
62 const updated = [order, ...existing].slice(0, 10);
63 localStorage.setItem(RECENT_ORDERS_KEY, JSON.stringify(updated));
64 } catch { /* ignore */ }
65}
66function timeAgo(ts: number, t: (key: string, vars?: Record<string, string | number>) => string): string {
67 const diff = Date.now() - ts;
68 const mins = Math.floor(diff / 60_000);

Callers 1

TradeModalContentFunction · 0.85

Calls 1

loadRecentOrdersFunction · 0.85

Tested by

no test coverage detected