fix(settings): harden network controls

This commit is contained in:
NimBold
2026-07-02 15:43:53 +03:30
parent d274e3af17
commit cfb5a5b6e0
9 changed files with 276 additions and 65 deletions
+5 -1
View File
@@ -274,7 +274,11 @@ export const useSettingsStore = create<SettingsState>()(
setShowMenuBarIcon: (showMenuBarIcon) => set({ showMenuBarIcon }),
setProxyMode: (proxyMode) => set({ proxyMode }),
setProxyHost: (proxyHost) => set({ proxyHost }),
setProxyPort: (proxyPort) => set({ proxyPort }),
setProxyPort: (proxyPort) => set({
proxyPort: Number.isFinite(proxyPort)
? Math.min(65535, Math.max(1, Math.trunc(proxyPort)))
: 8080
}),
setCustomUserAgent: (customUserAgent) => set({ customUserAgent }),
setAskWhereToSaveEachFile: (askWhereToSaveEachFile) => set({ askWhereToSaveEachFile }),
setPreventsSleepWhileDownloading: (preventsSleepWhileDownloading) => {