fix(settings): avoid creating default download folder (#116)

This commit is contained in:
Nexmoe
2026-01-15 21:21:09 +08:00
committed by GitHub
parent c1d1a1b912
commit fe55ac1a79
2 changed files with 2 additions and 9 deletions

View File

@@ -20,9 +20,7 @@ const ensureDirectoryExists = (dir: string) => {
}
const resolveDefaultDownloadPath = () => {
const downloadDir = path.join(os.homedir(), 'Downloads', 'VidBee')
ensureDirectoryExists(downloadDir)
return downloadDir
return path.join(os.homedir(), 'Downloads', 'VidBee')
}
const DEFAULT_DOWNLOAD_PATH = resolveDefaultDownloadPath()
@@ -75,7 +73,6 @@ class SettingsManager {
...defaultSettings,
downloadPath: DEFAULT_DOWNLOAD_PATH
})
ensureDirectoryExists(DEFAULT_DOWNLOAD_PATH)
}
private ensureDownloadDirectory(): void {
@@ -88,7 +85,6 @@ class SettingsManager {
if (normalizedDownloadPath !== currentPath) {
this.store.set('downloadPath', normalizedDownloadPath)
}
ensureDirectoryExists(normalizedDownloadPath)
} catch (error) {
scopedLoggers.system.error('Failed to verify download directory:', error)
}

View File

@@ -17,12 +17,9 @@ import { useAtom } from 'jotai'
import { AlertCircle, ExternalLink, Loader2, Settings2 } from 'lucide-react'
import { useCallback, useEffect, useMemo, useState } from 'react'
import { useTranslation } from 'react-i18next'
import {
DOWNLOAD_FEEDBACK_ISSUE_TITLE,
FeedbackLinkButtons
} from '../feedback/FeedbackLinks'
import { useCachedThumbnail } from '../../hooks/use-cached-thumbnail'
import { settingsAtom } from '../../store/settings'
import { DOWNLOAD_FEEDBACK_ISSUE_TITLE, FeedbackLinkButtons } from '../feedback/FeedbackLinks'
export interface SingleVideoState {
title: string