Numerious fixes.
This commit is contained in:
parent
619df83ddd
commit
90204e4f10
@ -235,7 +235,7 @@ const DashboardNavigation = () => {
|
|||||||
<Button
|
<Button
|
||||||
icon={<SearchIcon />}
|
icon={<SearchIcon />}
|
||||||
type='text'
|
type='text'
|
||||||
style={{ marginTop: '2px' }}
|
style={{ marginTop: '4px' }}
|
||||||
onClick={() => showSpotlight()}
|
onClick={() => showSpotlight()}
|
||||||
/>
|
/>
|
||||||
</KeyboardShortcut>
|
</KeyboardShortcut>
|
||||||
|
|||||||
@ -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 PropTypes from 'prop-types'
|
||||||
import { Table, Skeleton, Card, Button, Flex, Typography, Modal } from 'antd'
|
import { Table, Skeleton, Card, Button, Flex, Typography, Modal } from 'antd'
|
||||||
import PlusIcon from '../../Icons/PlusIcon'
|
import PlusIcon from '../../Icons/PlusIcon'
|
||||||
@ -91,17 +91,20 @@ const ObjectChildTable = ({
|
|||||||
return generated
|
return generated
|
||||||
}
|
}
|
||||||
|
|
||||||
const getResolvedRecordKey = (record) => {
|
const getResolvedRecordKey = useCallback(
|
||||||
if (typeof rowKey === 'function') {
|
(record) => {
|
||||||
return rowKey(record) ?? getFallbackRowKey(record)
|
if (typeof rowKey === 'function') {
|
||||||
}
|
return rowKey(record) ?? getFallbackRowKey(record)
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof rowKey === 'string' && rowKey.length > 0) {
|
if (typeof rowKey === 'string' && rowKey.length > 0) {
|
||||||
return record?.[rowKey] ?? getFallbackRowKey(record)
|
return record?.[rowKey] ?? getFallbackRowKey(record)
|
||||||
}
|
}
|
||||||
|
|
||||||
return getFallbackRowKey(record)
|
return getFallbackRowKey(record)
|
||||||
}
|
},
|
||||||
|
[rowKey]
|
||||||
|
)
|
||||||
|
|
||||||
const propertyMap = useMemo(() => {
|
const propertyMap = useMemo(() => {
|
||||||
const map = new Map()
|
const map = new Map()
|
||||||
@ -258,7 +261,8 @@ const ObjectChildTable = ({
|
|||||||
canAddRemove,
|
canAddRemove,
|
||||||
itemsSource,
|
itemsSource,
|
||||||
onChange,
|
onChange,
|
||||||
rowKey
|
rowKey,
|
||||||
|
getResolvedRecordKey
|
||||||
])
|
])
|
||||||
|
|
||||||
const skeletonData = useMemo(() => {
|
const skeletonData = useMemo(() => {
|
||||||
|
|||||||
@ -49,7 +49,7 @@ const WebAppSwitcher = () => {
|
|||||||
<Button
|
<Button
|
||||||
icon={isElectron ? <OpenInBrowserIcon /> : <OpenInAppIcon />}
|
icon={isElectron ? <OpenInBrowserIcon /> : <OpenInAppIcon />}
|
||||||
type='text'
|
type='text'
|
||||||
style={{ marginTop: '2px' }}
|
style={{ marginTop: '4px' }}
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|||||||
@ -291,9 +291,6 @@ const AuthProvider = ({ children }) => {
|
|||||||
})
|
})
|
||||||
}, [authenticated, token, expiresAt, userProfile, persistSession])
|
}, [authenticated, token, expiresAt, userProfile, persistSession])
|
||||||
|
|
||||||
const profileImageDependency =
|
|
||||||
userProfile?.profileImage?._id ?? userProfile?.profileImage
|
|
||||||
|
|
||||||
// Fetch and cache profile image when userProfile.profileImage changes
|
// Fetch and cache profile image when userProfile.profileImage changes
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const profileImage = userProfile?.profileImage
|
const profileImage = userProfile?.profileImage
|
||||||
@ -368,7 +365,7 @@ const AuthProvider = ({ children }) => {
|
|||||||
}
|
}
|
||||||
setProfileImageUrl(null)
|
setProfileImageUrl(null)
|
||||||
}
|
}
|
||||||
}, [profileImageDependency, token])
|
}, [userProfile?.profileImage, token])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('userProfile', userProfile)
|
console.log('userProfile', userProfile)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user