mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-03-16 23:16:20 +00:00
15 lines
680 B
TypeScript
15 lines
680 B
TypeScript
import { persisted } from 'svelte-persisted-store'
|
|
|
|
import native from '../native'
|
|
|
|
import { defaults } from '.'
|
|
|
|
export const settings = persisted('settings', defaults, { beforeRead: value => ({ ...defaults, ...value }) })
|
|
|
|
settings.subscribe(settings => {
|
|
const { torrentPersist, torrentDHT, torrentStreamedDownload, torrentSpeed, maxConns, torrentPort, dhtPort, torrentPeX } = settings
|
|
native.updateSettings({ torrentPersist, torrentDHT, torrentStreamedDownload, torrentSpeed, maxConns, torrentPort, dhtPort, torrentPeX })
|
|
native.setHideToTray(settings.hideToTray)
|
|
native.transparency(settings.idleAnimation)
|
|
if (settings.enableDoH) native.setDOH(settings.doHURL)
|
|
})
|