diff --git a/common/Router.svelte b/common/Router.svelte index ff2bd107..3eb41835 100644 --- a/common/Router.svelte +++ b/common/Router.svelte @@ -24,6 +24,8 @@ import { SUPPORTS } from '@/modules/support.js'; import { click } from '@/modules/click.js'; import { client } from '@/modules/torrent.js'; + import { settings } from '@/modules/settings.js'; + import IPC from '@/modules/ipc.js'; export let page = 'home' @@ -31,6 +33,8 @@ $: maxwidth = $isMobile ? '200px' : '60rem' onMount(() => { + if($settings.enableAutoUpdate && SUPPORTS.update) IPC.emit('update') + if (SUPPORTS.isAndroid) { let backButtonPressTimeout; window.Capacitor.Plugins.App.addListener("backButton", () => { diff --git a/common/modules/support.js b/common/modules/support.js index 27439f36..0d2a1575 100644 --- a/common/modules/support.js +++ b/common/modules/support.js @@ -2,7 +2,7 @@ export const SUPPORTS = { offscreenRender: true, - update: false, + update: true, angle: true, doh: true, dht: true, diff --git a/common/modules/util.js b/common/modules/util.js index fadd1086..cd7a3ab8 100644 --- a/common/modules/util.js +++ b/common/modules/util.js @@ -136,6 +136,7 @@ export const defaults = { slowSeeding: true, disableStartupVideo: true, amoledTheme: true, + enableAutoUpdate: true, torrentPersist: false, torrentDHT: false, torrentPeX: false, diff --git a/common/views/Settings/AppSettings.svelte b/common/views/Settings/AppSettings.svelte index 8a7b418b..81379fe4 100644 --- a/common/views/Settings/AppSettings.svelte +++ b/common/views/Settings/AppSettings.svelte @@ -4,6 +4,7 @@ import { resetSettings } from '@/modules/settings.js' import IPC from '@/modules/ipc.js' import { SUPPORTS } from '@/modules/support.js' + import SettingCard from './SettingCard.svelte'; async function importSettings () { localStorage.setItem('settings', await navigator.clipboard.readText()) @@ -25,6 +26,10 @@ } setInterval(checkUpdate, 1200000) + +