diff --git a/src/components/Dashboard/common/DashboardNavigation.jsx b/src/components/Dashboard/common/DashboardNavigation.jsx
index b025a68..1946bd5 100644
--- a/src/components/Dashboard/common/DashboardNavigation.jsx
+++ b/src/components/Dashboard/common/DashboardNavigation.jsx
@@ -235,7 +235,7 @@ const DashboardNavigation = () => {
}
type='text'
- style={{ marginTop: '2px' }}
+ style={{ marginTop: '4px' }}
onClick={() => showSpotlight()}
/>
diff --git a/src/components/Dashboard/common/ObjectChildTable.jsx b/src/components/Dashboard/common/ObjectChildTable.jsx
index 55cbabe..7ac9263 100644
--- a/src/components/Dashboard/common/ObjectChildTable.jsx
+++ b/src/components/Dashboard/common/ObjectChildTable.jsx
@@ -1,4 +1,4 @@
-import { useMemo, useEffect, useRef, useState } from 'react'
+import { useMemo, useEffect, useRef, useState, useCallback } from 'react'
import PropTypes from 'prop-types'
import { Table, Skeleton, Card, Button, Flex, Typography, Modal } from 'antd'
import PlusIcon from '../../Icons/PlusIcon'
@@ -91,17 +91,20 @@ const ObjectChildTable = ({
return generated
}
- const getResolvedRecordKey = (record) => {
- if (typeof rowKey === 'function') {
- return rowKey(record) ?? getFallbackRowKey(record)
- }
+ const getResolvedRecordKey = useCallback(
+ (record) => {
+ if (typeof rowKey === 'function') {
+ return rowKey(record) ?? getFallbackRowKey(record)
+ }
- if (typeof rowKey === 'string' && rowKey.length > 0) {
- return record?.[rowKey] ?? getFallbackRowKey(record)
- }
+ if (typeof rowKey === 'string' && rowKey.length > 0) {
+ return record?.[rowKey] ?? getFallbackRowKey(record)
+ }
- return getFallbackRowKey(record)
- }
+ return getFallbackRowKey(record)
+ },
+ [rowKey]
+ )
const propertyMap = useMemo(() => {
const map = new Map()
@@ -258,7 +261,8 @@ const ObjectChildTable = ({
canAddRemove,
itemsSource,
onChange,
- rowKey
+ rowKey,
+ getResolvedRecordKey
])
const skeletonData = useMemo(() => {
diff --git a/src/components/Dashboard/common/WebAppSwitcher.jsx b/src/components/Dashboard/common/WebAppSwitcher.jsx
index f963d0c..25a056c 100644
--- a/src/components/Dashboard/common/WebAppSwitcher.jsx
+++ b/src/components/Dashboard/common/WebAppSwitcher.jsx
@@ -49,7 +49,7 @@ const WebAppSwitcher = () => {
: }
type='text'
- style={{ marginTop: '2px' }}
+ style={{ marginTop: '4px' }}
onClick={handleClick}
/>
diff --git a/src/components/Dashboard/context/AuthContext.jsx b/src/components/Dashboard/context/AuthContext.jsx
index dacb516..753d686 100644
--- a/src/components/Dashboard/context/AuthContext.jsx
+++ b/src/components/Dashboard/context/AuthContext.jsx
@@ -291,9 +291,6 @@ const AuthProvider = ({ children }) => {
})
}, [authenticated, token, expiresAt, userProfile, persistSession])
- const profileImageDependency =
- userProfile?.profileImage?._id ?? userProfile?.profileImage
-
// Fetch and cache profile image when userProfile.profileImage changes
useEffect(() => {
const profileImage = userProfile?.profileImage
@@ -368,7 +365,7 @@ const AuthProvider = ({ children }) => {
}
setProfileImageUrl(null)
}
- }, [profileImageDependency, token])
+ }, [userProfile?.profileImage, token])
useEffect(() => {
console.log('userProfile', userProfile)