Skip to content

Commit

Permalink
Update add.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
VirtualHotBar committed May 17, 2024
1 parent 2f567d2 commit a3b9cc1
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/page/mount/add.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default function AddMount_page() {

const isMountPathCustom = mountPath !== '*' && !mountPath.startsWith('~/Desktop/');
const mountPathuIsDriveLetter = isWindows && (mountPath === '*' || mountPath.endsWith(':') || mountPath.endsWith(':/'));
console.log(mountPath);


const checkWinFspState = async () => {
Expand Down Expand Up @@ -67,9 +68,9 @@ export default function AddMount_page() {

useEffect(() => {
setMountPath(mountPath.replace(/\\/g, '/').replace(/\/+/g, '/'))
/* if (mountPathuIsDriveLetter) {
mountOptFormHook && mountOptFormHook.setFieldsValue({ VolumeName: storageName })
} */
/* if (mountPathuIsDriveLetter) {
mountOptFormHook && mountOptFormHook.setFieldsValue({ VolumeName: storageName })
} */
}, [mountPath])

useEffect(() => {
Expand All @@ -95,21 +96,24 @@ export default function AddMount_page() {
}, [])

useEffect(() => {
//默认挂载路径
if (isWindows) {
//setMountPath('*')
setMountPath('~/Desktop/' + storageName)
if (!isEditMode) {
//默认挂载路径
if (isWindows) {
//setMountPath('*')
setMountPath('~/Desktop/' + storageName)


} else {
if (storageName) {
if (rcloneInfo.version.os.toLowerCase().includes('darwin')) {
setMountPath('~/Desktop/' + storageName)
} else {
setMountPath('/mnt/' + storageName)
} else {
if (storageName) {
if (rcloneInfo.version.os.toLowerCase().includes('darwin')) {
setMountPath('~/Desktop/' + storageName)
} else {
setMountPath('/mnt/' + storageName)
}
}
}
}

}, [storageName])

useEffect(() => {
Expand Down

0 comments on commit a3b9cc1

Please sign in to comment.