From 78d7a91b888b1fcf78a329e092a5bec87496024c Mon Sep 17 00:00:00 2001 From: Sinclair Chen Date: Wed, 31 Jul 2024 16:46:53 -0700 Subject: [PATCH] Fix 0 in answer edit panel --- common/src/supabase/contracts.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/common/src/supabase/contracts.ts b/common/src/supabase/contracts.ts index bf828f1ef1..d4eb86bed1 100644 --- a/common/src/supabase/contracts.ts +++ b/common/src/supabase/contracts.ts @@ -1,11 +1,5 @@ import { chunk, groupBy, mapValues, sortBy } from 'lodash' -import { - millisToTs, - Row, - run, - SupabaseClient, - tsToMillis, -} from './utils' +import { millisToTs, Row, run, SupabaseClient, tsToMillis } from './utils' import { Contract } from '../contract' import { Answer } from 'common/answer' import { Json } from 'common/supabase/schema' @@ -147,7 +141,9 @@ export const convertAnswer = (row: Row<'answers'>): Answer => ({ // resolutions resolution: row.resolution as any, - resolutionTime: row.resolution_time ? tsToMillis(row.resolution_time) : 0, + resolutionTime: row.resolution_time + ? tsToMillis(row.resolution_time) + : undefined, resolutionProbability: row.resolution_probability!, resolverId: row.resolver_id!,