From 4e2de66679653701b975d9bc66e4f0c5ccc75028 Mon Sep 17 00:00:00 2001 From: Jack Frain Date: Tue, 22 Oct 2024 09:55:04 -0400 Subject: [PATCH] fix(specs): make spec upload dal fixed --- src/components/item.tsx | 4 +++- src/dal/index.ts | 2 +- src/lib/index.ts | 9 --------- src/services/ao.ts | 1 + 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/components/item.tsx b/src/components/item.tsx index d1aa859..adf5762 100644 --- a/src/components/item.tsx +++ b/src/components/item.tsx @@ -21,9 +21,11 @@ const Asset = ({ onClick }: AssetProps) => { + // TODO: timestamps for old vs new are different - fix + const timestamp = typeof Timestamp === 'string' && +Timestamp > 2000000000 ? Math.floor(Number(Timestamp) / 1000) : Math.floor(Number(Timestamp)) const date = typeof Timestamp === 'string' && +Timestamp > 0 - ? format(fromUnixTime(Math.floor(Number(Timestamp))), 'M/d/yyyy') + ? format(fromUnixTime(timestamp), 'M/d/yyyy') : 'pending' return (
diff --git a/src/dal/index.ts b/src/dal/index.ts index 5c105d7..06ab869 100644 --- a/src/dal/index.ts +++ b/src/dal/index.ts @@ -68,7 +68,7 @@ const uploadSchema = z .args( z.object({ data: z.string(), - tags: z.array(z.object({ name: z.string(), value: z.string() })) + tags: z.array(z.object({ name: z.string(), value: z.union([z.string(), z.array(z.string())]) })) }) ) .returns(z.promise(z.string())) diff --git a/src/lib/index.ts b/src/lib/index.ts index 7402399..2f9dafd 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -45,15 +45,6 @@ export default { const stamp = fromPromise(stampSchema.implement(services.stamp)) const stampCounts = fromPromise(stampCountsSchema.implement(services.stampCounts)) - // const stamp = fromPromise(services.stamp) - - const isVouched = (addr) => - fromPromise(isVouchedSchema.implement(services.isVouched))(addr).chain((res) => - res - ? Resolved(addr) - : Rejected(new Error("MUST be vouched!")), - ) - return { save: (md: string) => of(md) diff --git a/src/services/ao.ts b/src/services/ao.ts index 6610266..2c00f77 100644 --- a/src/services/ao.ts +++ b/src/services/ao.ts @@ -67,6 +67,7 @@ export const upload = async (md: { data: md.data, signer: createDataItemSigner(window.arweaveWallet) } + const result = await message(args) return result