Compare commits

...

2 Commits

Author SHA1 Message Date
235b038ecc Refactor duplicate installation handling in AppUpdateProvider
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
- Updated state management for duplicate installations by setting default values to null, simplifying the logic for handling duplicates.
- Changed the initial state of duplicatePromptOpen to false, improving the user experience by preventing unnecessary prompts on load.
2026-08-09 11:19:55 +01:00
b254c0c94d Enhance AppUpdateProvider with improved duplicate installation handling
- Updated the state management for duplicate installations to include specific paths, enhancing clarity for users.
- Modified modal titles to include icons for better visual representation of update statuses.
- Adjusted modal properties for improved user experience during duplicate installation prompts.
2026-08-09 11:19:17 +01:00

View File

@ -16,6 +16,7 @@ import { ElectronContext } from './ElectronContext'
import NewAppUpdate from '../Management/AppUpdates/NewAppUpdate' import NewAppUpdate from '../Management/AppUpdates/NewAppUpdate'
import AppUpdateProgress from '../Management/AppUpdates/AppUpdateProgress' import AppUpdateProgress from '../Management/AppUpdates/AppUpdateProgress'
import SoftwareUpdateIcon from '../../Icons/SoftwareUpdateIcon' import SoftwareUpdateIcon from '../../Icons/SoftwareUpdateIcon'
import ExclamationOctogonIcon from '../../Icons/ExclamationOctagonIcon'
const { Text } = Typography const { Text } = Typography
@ -459,7 +460,12 @@ export const AppUpdateProvider = ({ children }) => {
</Space> </Space>
</Modal> </Modal>
<Modal <Modal
title='Software Update' title={
<Flex align='center' gap='middle'>
<SoftwareUpdateIcon style={{ fontSize: 18 }} />
Software Update
</Flex>
}
open={noUpdateOpen} open={noUpdateOpen}
okText='OK' okText='OK'
style={{ maxWidth: 430 }} style={{ maxWidth: 430 }}
@ -546,11 +552,16 @@ export const AppUpdateProvider = ({ children }) => {
</Text> </Text>
</Modal> </Modal>
<Modal <Modal
title='Duplicate Installation Found' title={
<Flex align='center' gap='middle'>
<ExclamationOctogonIcon />
Duplicate Installation Found
</Flex>
}
open={Boolean(duplicatePromptOpen && duplicateInstall)} open={Boolean(duplicatePromptOpen && duplicateInstall)}
style={{ maxWidth: 480 }} width={!removingDuplicate && !duplicateRemovalResult ? 560 : 430}
centered centered
closable={!removingDuplicate} closable={false}
maskClosable={false} maskClosable={false}
onCancel={removingDuplicate ? undefined : closeDuplicatePrompt} onCancel={removingDuplicate ? undefined : closeDuplicatePrompt}
footer={ footer={
@ -599,10 +610,10 @@ export const AppUpdateProvider = ({ children }) => {
<Space direction='vertical' size='small'> <Space direction='vertical' size='small'>
<Text> <Text>
Farm Control is now installed in your user applications folder, Farm Control is now installed in your user applications folder,
but an older copy is still installed at: but an older copy is still installed at:{' '}
</Text> <Text code>{duplicateInstall?.duplicatePath}</Text>.{' '}
<Text code>{duplicateInstall?.duplicatePath}</Text>
<Text>Do you want to remove the duplicate installation?</Text> <Text>Do you want to remove the duplicate installation?</Text>
</Text>
</Space> </Space>
)} )}
</Modal> </Modal>