mirror of
https://github.com/NoCrypt/migu.git
synced 2026-01-11 20:10:22 +00:00
feat: add auto updater toggle
This commit is contained in:
parent
5883ebb887
commit
5620a99776
6 changed files with 19 additions and 3 deletions
|
|
@ -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", () => {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
export const SUPPORTS = {
|
||||
offscreenRender: true,
|
||||
update: false,
|
||||
update: true,
|
||||
angle: true,
|
||||
doh: true,
|
||||
dht: true,
|
||||
|
|
|
|||
|
|
@ -136,6 +136,7 @@ export const defaults = {
|
|||
slowSeeding: true,
|
||||
disableStartupVideo: true,
|
||||
amoledTheme: true,
|
||||
enableAutoUpdate: true,
|
||||
torrentPersist: false,
|
||||
torrentDHT: false,
|
||||
torrentPeX: false,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
</script>
|
||||
<script>
|
||||
export let settings
|
||||
</script>
|
||||
|
||||
<div class='d-inline-flex flex-column'>
|
||||
<button
|
||||
use:click={importSettings}
|
||||
|
|
@ -39,6 +44,12 @@
|
|||
Export Settings To Clipboard
|
||||
</button>
|
||||
{#if SUPPORTS.update}
|
||||
<SettingCard title='Enable auto update' description='Enables auto updater upon startup. Disable this if you have issues with it.'>
|
||||
<div class='custom-switch'>
|
||||
<input type='checkbox' id='enable-auto-updater' bind:checked={settings.enableAutoUpdate} />
|
||||
<label for='enable-auto-updater'>{settings.enableAutoUpdate ? 'On' : 'Off'}</label>
|
||||
</div>
|
||||
</SettingCard>
|
||||
<button
|
||||
use:click={checkUpdate}
|
||||
class='btn btn-primary mx-20 mt-10'
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@
|
|||
</Tab>
|
||||
<Tab>
|
||||
<div class='root h-full w-full overflow-y-md-auto p-20' use:smoothScroll>
|
||||
<AppSettings />
|
||||
<AppSettings bind:settings={$settings} />
|
||||
<div class='h-250' />
|
||||
</div>
|
||||
</Tab>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ ipcMain.on('update', () => {
|
|||
autoUpdater.checkForUpdatesAndNotify()
|
||||
})
|
||||
|
||||
autoUpdater.checkForUpdatesAndNotify()
|
||||
// autoUpdater.checkForUpdatesAndNotify()
|
||||
export default class Updater {
|
||||
hasUpdate = false
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue