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.
This commit is contained in:
parent
7d79e0d206
commit
b254c0c94d
@ -16,6 +16,7 @@ import { ElectronContext } from './ElectronContext'
|
||||
import NewAppUpdate from '../Management/AppUpdates/NewAppUpdate'
|
||||
import AppUpdateProgress from '../Management/AppUpdates/AppUpdateProgress'
|
||||
import SoftwareUpdateIcon from '../../Icons/SoftwareUpdateIcon'
|
||||
import ExclamationOctogonIcon from '../../Icons/ExclamationOctagonIcon'
|
||||
|
||||
const { Text } = Typography
|
||||
|
||||
@ -144,8 +145,11 @@ export const AppUpdateProvider = ({ children }) => {
|
||||
const [installingUpdate, setInstallingUpdate] = useState(null)
|
||||
const [updateProgress, setUpdateProgress] = useState(null)
|
||||
const [completedUpdate, setCompletedUpdate] = useState(null)
|
||||
const [duplicateInstall, setDuplicateInstall] = useState(null)
|
||||
const [duplicatePromptOpen, setDuplicatePromptOpen] = useState(false)
|
||||
const [duplicateInstall, setDuplicateInstall] = useState({
|
||||
duplicatePath: 'C:\\Program Files\\Farm Control',
|
||||
originalPath: 'C:\\Program Files\\Farm Control'
|
||||
})
|
||||
const [duplicatePromptOpen, setDuplicatePromptOpen] = useState(true)
|
||||
const [removingDuplicate, setRemovingDuplicate] = useState(false)
|
||||
const [duplicateRemovalResult, setDuplicateRemovalResult] = useState(null)
|
||||
const runningCheckRef = useRef(null)
|
||||
@ -459,7 +463,12 @@ export const AppUpdateProvider = ({ children }) => {
|
||||
</Space>
|
||||
</Modal>
|
||||
<Modal
|
||||
title='Software Update'
|
||||
title={
|
||||
<Flex align='center' gap='middle'>
|
||||
<SoftwareUpdateIcon style={{ fontSize: 18 }} />
|
||||
Software Update
|
||||
</Flex>
|
||||
}
|
||||
open={noUpdateOpen}
|
||||
okText='OK'
|
||||
style={{ maxWidth: 430 }}
|
||||
@ -546,11 +555,16 @@ export const AppUpdateProvider = ({ children }) => {
|
||||
</Text>
|
||||
</Modal>
|
||||
<Modal
|
||||
title='Duplicate Installation Found'
|
||||
title={
|
||||
<Flex align='center' gap='middle'>
|
||||
<ExclamationOctogonIcon />
|
||||
Duplicate Installation Found
|
||||
</Flex>
|
||||
}
|
||||
open={Boolean(duplicatePromptOpen && duplicateInstall)}
|
||||
style={{ maxWidth: 480 }}
|
||||
width={!removingDuplicate && !duplicateRemovalResult ? 560 : 430}
|
||||
centered
|
||||
closable={!removingDuplicate}
|
||||
closable={false}
|
||||
maskClosable={false}
|
||||
onCancel={removingDuplicate ? undefined : closeDuplicatePrompt}
|
||||
footer={
|
||||
@ -599,10 +613,10 @@ export const AppUpdateProvider = ({ children }) => {
|
||||
<Space direction='vertical' size='small'>
|
||||
<Text>
|
||||
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 code>{duplicateInstall?.duplicatePath}</Text>.{' '}
|
||||
<Text>Do you want to remove the duplicate installation?</Text>
|
||||
</Text>
|
||||
<Text code>{duplicateInstall?.duplicatePath}</Text>
|
||||
<Text>Do you want to remove the duplicate installation?</Text>
|
||||
</Space>
|
||||
)}
|
||||
</Modal>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user