mirror of
https://github.com/NoCrypt/migu.git
synced 2026-04-04 16:49:42 +00:00
fix: menubar on electron fix: sections loading errors fix: changelog styling fix: restore settings
58 lines
1.5 KiB
Svelte
58 lines
1.5 KiB
Svelte
<script context='module'>
|
|
import { click } from '@/modules/click.js'
|
|
import { toast } from 'svelte-sonner'
|
|
import { resetSettings } from '@/modules/settings.js'
|
|
import IPC from '@/modules/ipc.js'
|
|
import { SUPPORTS } from '@/modules/support.js'
|
|
|
|
async function importSettings () {
|
|
localStorage.setItem('settings', await navigator.clipboard.readText())
|
|
location.reload()
|
|
}
|
|
function exportSettings () {
|
|
navigator.clipboard.writeText(localStorage.getItem('settings'))
|
|
toast('Copied to clipboard', {
|
|
description: 'Copied settings to clipboard',
|
|
duration: 5000
|
|
})
|
|
}
|
|
function restoreSettigs () {
|
|
resetSettings()
|
|
location.reload()
|
|
}
|
|
function checkUpdate () {
|
|
IPC.emit('update')
|
|
}
|
|
setInterval(checkUpdate, 1200000)
|
|
</script>
|
|
<div class='d-inline-flex flex-column'>
|
|
<button
|
|
use:click={importSettings}
|
|
class='btn btn-primary mx-20 mt-10'
|
|
type='button'>
|
|
Import Settings From Clipboard
|
|
</button>
|
|
<button
|
|
use:click={exportSettings}
|
|
class='btn btn-primary mx-20 mt-10'
|
|
type='button'>
|
|
Export Settings To Clipboard
|
|
</button>
|
|
{#if SUPPORTS.update}
|
|
<button
|
|
use:click={checkUpdate}
|
|
class='btn btn-primary mx-20 mt-10'
|
|
type='button'>
|
|
Check For Updates
|
|
</button>
|
|
{/if}
|
|
<button
|
|
use:click={restoreSettigs}
|
|
class='btn btn-danger mx-20 mt-10'
|
|
type='button'
|
|
data-toggle='tooltip'
|
|
data-placement='top'
|
|
data-title='Restores All Settings Back To Their Recommended Defaults'>
|
|
Restore Default Settings
|
|
</button>
|
|
</div>
|