fix: bw/stats 404, gateway links, history crash
- swr.ts: remove useBandwidth(), drop bw from useDashboard() - events/route.ts: skip bandwidth SSE (Kubo 0.28.0 unsupported) - usage/page.tsx: remove getBWStats call + bw references - helpers.ts: gatewayLink -> ipfs.maos.dedyn.io (subdomain only) - upload/page.tsx: fix local gatewayLink (subdomain only) - storage.ts: update default gatewayUrl, add defensive getHistory()
This commit is contained in:
+6
-1
@@ -85,7 +85,12 @@ export async function uploadFile(file: File): Promise<{ cid: string; size: numbe
|
||||
credentials: 'include',
|
||||
});
|
||||
if (!res.ok) throw new Error(`Upload failed: ${res.statusText}`);
|
||||
return res.json();
|
||||
const data = await res.json();
|
||||
// Kubo API returns { Hash, Size, Name }, normalize to { cid, size }
|
||||
return {
|
||||
cid: data.cid || data.Hash || data.hash || '',
|
||||
size: data.size || data.Size || 0,
|
||||
};
|
||||
}
|
||||
|
||||
export async function listFiles(): Promise<{ name: string; cid: string; size: number; modified: string }[]> {
|
||||
|
||||
Reference in New Issue
Block a user