Skip to content

Commit

Permalink
fix: 341
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaUnknown committed Oct 16, 2023
1 parent 11651cd commit 2328c2a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/renderer/views/Search.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
let canScroll = true
async function loadTillFull () {
async function loadTillFull (_key) {
if (!container) return
const cachedKey = $key
canScroll = false
Expand Down
10 changes: 8 additions & 2 deletions src/renderer/views/Settings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
import { defaults } from '@/../common/util.js'
export let alToken = localStorage.getItem('ALtoken') || null
export const set = { ...defaults, ...(JSON.parse(localStorage.getItem('settings')) || {}) }
let storedSettings = { ...defaults }
try {
storedSettings = JSON.parse(localStorage.getItem('settings'))
} catch (e) {}
export const set = { ...defaults, ...storedSettings }
if (set.enableDoH) window.IPC.emit('doh', set.doHURL)
window.addEventListener('paste', ({ clipboardData }) => {
if (clipboardData.items?.[0]) {
Expand Down Expand Up @@ -110,7 +116,7 @@
let settings = set
$: saveSettings(settings)
$: window.IPC.emit('discord_status', settings.showDetailsInRPC)
function saveSettings () {
function saveSettings (settings) {
localStorage.setItem('settings', JSON.stringify(settings))
}
function restoreSettings () {
Expand Down

0 comments on commit 2328c2a

Please sign in to comment.