Compare commits

...

4 Commits

5 changed files with 38 additions and 34 deletions

View File

@ -32,7 +32,7 @@ const STAGE_CONFIG = {
icon: CloudIcon, icon: CloudIcon,
labels: { labels: {
pending: 'Download', pending: 'Download',
active: 'Downloading', active: 'Downloading...',
complete: 'Downloaded', complete: 'Downloaded',
error: 'Download failed' error: 'Download failed'
} }
@ -41,7 +41,7 @@ const STAGE_CONFIG = {
icon: HostIcon, icon: HostIcon,
labels: { labels: {
pending: 'Install', pending: 'Install',
active: 'Installing', active: 'Installing...',
complete: 'Installed', complete: 'Installed',
error: 'Install failed' error: 'Install failed'
} }
@ -101,28 +101,28 @@ const UpdateStage = ({ stage, status, percent, detail }) => {
: StageIcon : StageIcon
return ( return (
<Flex vertical gap={4}> <Flex align='center' gap='middle'>
<Flex align='center' gap='middle'> <StatusIcon style={{ fontSize: 20, color, flexShrink: 0 }} />
<StatusIcon style={{ fontSize: 20, color, flexShrink: 0 }} /> <Flex align='center' gap='small' style={{ flex: 1, minWidth: 0 }}>
<Flex align='center' gap='small' style={{ flex: 1, minWidth: 0 }}> <Text style={{ flexShrink: 0, minWidth: 96 }}>
<Text style={{ flexShrink: 0, minWidth: 96 }}> {config.labels[resolvedStatus]}
{config.labels[resolvedStatus]} </Text>
</Text> {showProgress && (
{showProgress && ( <Flex vertical gap={4}>
<Progress <Progress
percent={resolvedPercent} percent={resolvedPercent}
status={getProgressStatus(resolvedStatus)} status={getProgressStatus(resolvedStatus)}
showInfo={typeof resolvedPercent === 'number'} showInfo={typeof resolvedPercent === 'number'}
style={{ flex: 1, margin: 0 }} style={{ flex: 1, margin: 0 }}
/> />
)} {detail && (
</Flex> <Text type='secondary' style={{ marginLeft: 36 }}>
{detail}
</Text>
)}
</Flex>
)}
</Flex> </Flex>
{detail && (
<Text type='secondary' style={{ marginLeft: 36 }}>
{detail}
</Text>
)}
</Flex> </Flex>
) )
} }
@ -161,6 +161,8 @@ const AppUpdateProgress = ({ progress, update, onClose }) => {
? `${downloaded} of ${total}` ? `${downloaded} of ${total}`
: null : null
const installDetail = installStatus === 'active' ? message : null
return ( return (
<Flex vertical gap='middle'> <Flex vertical gap='middle'>
<Text> <Text>
@ -181,6 +183,7 @@ const AppUpdateProgress = ({ progress, update, onClose }) => {
stage='install' stage='install'
status={installStatus} status={installStatus}
percent={installPercent} percent={installPercent}
detail={installDetail}
/> />
</Flex> </Flex>

View File

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

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

View File

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

View File

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