handle * mount destination on windows

This commit is contained in:
FTCHD
2026-05-10 22:59:20 +03:00
parent 60b1490a10
commit 979d34634e
2 changed files with 8 additions and 7 deletions
+2 -2
View File
@@ -644,7 +644,7 @@ export async function startMount({
: undefined
if (destination === '*' && currentPlatform === 'windows') {
await pRetry(
const response = await pRetry(
async () =>
await rclone('/mount/mount', {
params: {
@@ -662,7 +662,7 @@ export async function startMount({
retries: 3,
}
)
return
return response?.mountPoint as string | undefined
}
const {
+6 -5
View File
@@ -116,7 +116,7 @@ export default function Mount() {
mutationFn: async ({ dest, source }: { dest?: string; source?: string }) => {
if (!dest || !source) throw new Error('Destination and source are required')
await startMount({
const resolvedMountPoint = await startMount({
source: source,
destination: dest,
options: {
@@ -127,7 +127,7 @@ export default function Mount() {
},
})
return dest
return resolvedMountPoint || dest
},
onSuccess: async () => {
if (usePersistedStore.getState().acknowledgements.includes('firstMount')) {
@@ -428,12 +428,13 @@ export default function Mount() {
size="lg"
color="primary"
onPress={async () => {
if (!dest) return
const mountPoint = startMountMutation.data
if (!mountPoint) return
try {
await openPath(dest)
await openPath(mountPoint)
} catch (err) {
console.error('[Mount] Error opening path:', err)
await message(`Failed to open ${dest} (${err})`, {
await message(`Failed to open ${mountPoint} (${err})`, {
title: 'Open Error',
kind: 'error',
})