Skip to content

Commit

Permalink
fix portal time & nft error
Browse files Browse the repository at this point in the history
  • Loading branch information
wow-sven committed May 28, 2024
1 parent 13318e5 commit 30058a4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions infra/rooch-portal/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_ROOCH_OPERATING_ADDRESS=0xb7ac336861ff431cf867400a1eaa9708b5666954b5268486e6bd2e948aab1a42
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import {
} from '@roochnetwork/rooch-sdk-kit'
import { Copy, ChevronDown, ChevronUp, Check, AlertCircle } from 'lucide-react'

import {formatTimestamp} from '@/utils/format.ts'

interface Session {
authenticationKey: string
appName: string
Expand All @@ -41,11 +43,6 @@ interface ExpandableRowProps {
remove: (authKey: string) => void
}

const formatTimestamp = (timestamp: number): string => {
const date = new Date(timestamp)
return date.toLocaleString()
}

const copyToClipboard = async (text: string, setCopied: (value: boolean) => void) => {
try {
await navigator.clipboard.writeText(text)
Expand Down Expand Up @@ -116,6 +113,8 @@ export const ManageSessions: React.FC = () => {
)
}

console.log(sessionKeys)

return (
<div className="rounded-lg border w-full">
<Table>
Expand Down
8 changes: 8 additions & 0 deletions infra/rooch-portal/src/utils/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

import { PaymentTypes } from '@/common/interface'

export const formatTimestamp = (timestamp: number): string => {
if (timestamp < 1e10) {
timestamp *= 1000
}
const date = new Date(timestamp);
return date.toLocaleString();
}

export const formatCoin = (balance: number, decimals: number, precision = 2) => {
const divisor = Math.pow(10, decimals)
return (balance / divisor).toFixed(precision)
Expand Down

0 comments on commit 30058a4

Please sign in to comment.