Numerious fixes.

This commit is contained in:
Tom Butcher 2026-06-21 20:19:22 +01:00
parent 619df83ddd
commit 90204e4f10
4 changed files with 18 additions and 17 deletions

View File

@ -235,7 +235,7 @@ const DashboardNavigation = () => {
<Button
icon={<SearchIcon />}
type='text'
style={{ marginTop: '2px' }}
style={{ marginTop: '4px' }}
onClick={() => showSpotlight()}
/>
</KeyboardShortcut>

View File

@ -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(() => {

View File

@ -49,7 +49,7 @@ const WebAppSwitcher = () => {
<Button
icon={isElectron ? <OpenInBrowserIcon /> : <OpenInAppIcon />}
type='text'
style={{ marginTop: '2px' }}
style={{ marginTop: '4px' }}
onClick={handleClick}
/>
</Tooltip>

View File

@ -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)