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 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
|
||||||
|
|
||||||
@ -144,8 +145,11 @@ export const AppUpdateProvider = ({ children }) => {
|
|||||||
const [installingUpdate, setInstallingUpdate] = useState(null)
|
const [installingUpdate, setInstallingUpdate] = useState(null)
|
||||||
const [updateProgress, setUpdateProgress] = useState(null)
|
const [updateProgress, setUpdateProgress] = useState(null)
|
||||||
const [completedUpdate, setCompletedUpdate] = useState(null)
|
const [completedUpdate, setCompletedUpdate] = useState(null)
|
||||||
const [duplicateInstall, setDuplicateInstall] = useState(null)
|
const [duplicateInstall, setDuplicateInstall] = useState({
|
||||||
const [duplicatePromptOpen, setDuplicatePromptOpen] = useState(false)
|
duplicatePath: 'C:\\Program Files\\Farm Control',
|
||||||
|
originalPath: 'C:\\Program Files\\Farm Control'
|
||||||
|
})
|
||||||
|
const [duplicatePromptOpen, setDuplicatePromptOpen] = useState(true)
|
||||||
const [removingDuplicate, setRemovingDuplicate] = useState(false)
|
const [removingDuplicate, setRemovingDuplicate] = useState(false)
|
||||||
const [duplicateRemovalResult, setDuplicateRemovalResult] = useState(null)
|
const [duplicateRemovalResult, setDuplicateRemovalResult] = useState(null)
|
||||||
const runningCheckRef = useRef(null)
|
const runningCheckRef = useRef(null)
|
||||||
@ -459,7 +463,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 +555,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 +613,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 code>{duplicateInstall?.duplicatePath}</Text>.{' '}
|
||||||
|
<Text>Do you want to remove the duplicate installation?</Text>
|
||||||
</Text>
|
</Text>
|
||||||
<Text code>{duplicateInstall?.duplicatePath}</Text>
|
|
||||||
<Text>Do you want to remove the duplicate installation?</Text>
|
|
||||||
</Space>
|
</Space>
|
||||||
)}
|
)}
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user