Merge branch 'production' into main

This commit is contained in:
tjs 2023-04-08 19:31:30 -04:00
commit 856e54df8a
5 changed files with 11 additions and 7 deletions

View File

@ -136,12 +136,12 @@ export const ConnectWalletButton: React.FC = () => {
{!loadProfileDetails && !isMobile ? (
<div className="ml-2 w-32 text-left">
<p className="mb-0.5 truncate text-xs font-bold capitalize text-th-fgd-1">
{profileDetails.profile_name}
{profileDetails?.profile_name}
</p>
<p className="mb-0 text-xs text-th-fgd-4">
{profileDetails.wallet_pk
{profileDetails?.wallet_pk
? abbreviateAddress(
new PublicKey(profileDetails.wallet_pk)
new PublicKey(profileDetails?.wallet_pk)
)
: ''}
</p>

View File

@ -115,7 +115,7 @@ const MarketDetails = () => {
</Tooltip>
</div>
<div className="text-th-fgd-1 md:text-xs">
{`${market?.funding1h.toFixed(4)}% (${(
{`${market?.funding1h?.toFixed(4)}% (${(
market?.funding1h *
24 *
365
@ -129,7 +129,7 @@ const MarketDetails = () => {
<div className="flex items-center text-th-fgd-1 md:text-xs">
{usdFormatter(market?.openInterestUsd, 0)}
<Tooltip
content={`${market?.openInterest.toLocaleString(
content={`${market?.openInterest?.toLocaleString(
undefined,
{
maximumFractionDigits:

View File

@ -14,6 +14,8 @@ const ProfileImage = ({
}) => {
const profile = useMangoStore((s) => s.profile.details)
if (!profile) return null
return imageUrl || (isOwnerProfile && profile.profile_image_url) ? (
<img
alt=""

View File

@ -149,6 +149,7 @@ const AccountOverviewStats = ({ hourlyPerformanceStats, accountValue }) => {
if (performanceRange === '3m') {
setChartData(hourlyPerformanceStats.slice().reverse())
}
if (!chartData?.length) return
if (performanceRange === '30d') {
const start = new Date(
// @ts-ignore
@ -157,7 +158,8 @@ const AccountOverviewStats = ({ hourlyPerformanceStats, accountValue }) => {
const chartData = cloneDeep(hourlyPerformanceStats).filter(
(d) => new Date(d.time).getTime() > start
)
const pnlStart = chartData[chartData.length - 1].pnl
const pnlStart = chartData[chartData.length - 1]?.pnl
const perpPnlStart = chartData[chartData.length - 1].perp_pnl
for (let i = 0; i < chartData.length; i++) {
if (i === chartData.length - 1) {

View File

@ -333,7 +333,7 @@ export default function Account() {
{pubkey && mangoAccount ? (
profileData && !loadProfileDetails ? (
<Link
href={`/profile?name=${profileData?.profile_name.replace(
href={`/profile?name=${profileData?.profile_name?.replace(
/\s/g,
'-'
)}`}