From 244552b16b0c9cb5d1cc71dfba4abb28cd4bfcd2 Mon Sep 17 00:00:00 2001 From: Jonathan Staab Date: Wed, 8 Mar 2023 15:16:05 -0600 Subject: [PATCH] Reduce the delay for persisting stuff to the database to avoid getting half-logged in --- ROADMAP.md | 4 +++- src/agent/database.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index f7453fc7..b45e21e8 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -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 diff --git a/src/agent/database.ts b/src/agent/database.ts index 56c85cd6..0d982100 100644 --- a/src/agent/database.ts +++ b/src/agent/database.ts @@ -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) {