Skip to content

Commit

Permalink
Merge branch 'production' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
tlrjs committed Apr 8, 2023
2 parents 7333da7 + a96af82 commit 856e54d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions components/ConnectWalletButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions components/MarketDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions components/ProfileImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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=""
Expand Down
4 changes: 3 additions & 1 deletion components/account_page/AccountOverviewStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pages/account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
'-'
)}`}
Expand Down

1 comment on commit 856e54d

@vercel
Copy link

@vercel vercel bot commented on 856e54d Apr 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.