Reduce the delay for persisting stuff to the database to avoid getting half-logged in

This commit is contained in:
Jonathan Staab 2023-03-08 15:16:05 -06:00
parent 6c12aab69f
commit 244552b16b
2 changed files with 5 additions and 3 deletions

View File

@ -1,8 +1,10 @@
# Current
- [ ] Log in as user button
- [ ] Gray out messages tab when using pubkey login
- [ ] Collapse relaycard and relaycardsimple?
- [ ] Create my own version of nostr.how and extension explanation
- [ ] Make new notes thing fixed position
- [ ] Make new notes thing on feeds fixed position
- [ ] Review sampleRelays, seems like we shouldn't be shuffling
- [ ] Go over onboarding process, suggest some good relays for newcomers

View File

@ -1,5 +1,5 @@
import type {Writable} from 'svelte/store'
import {debounce, throttle} from 'throttle-debounce'
import {throttle} from 'throttle-debounce'
import {omit, prop, partition, is, find, without, pluck, all, identity} from 'ramda'
import {writable, derived} from 'svelte/store'
import {createMap, isObject, ensurePlural} from 'hurdak/lib/hurdak'
@ -106,7 +106,7 @@ class Table {
this.ready.set(true)
})()
}
_persist = debounce(10_000, () => {
_persist = throttle(1_000, () => {
callLocalforage('setItem', this.name, this.data)
})
_setAndNotify(newData) {