feat: in-memory fallback for storing user profiles #110
@ -7,7 +7,8 @@ import EventKind from "Nostr/EventKind";
|
|||||||
import { Subscriptions } from "Nostr/Subscriptions";
|
import { Subscriptions } from "Nostr/Subscriptions";
|
||||||
import { addDirectMessage, addNotifications, setFollows, setRelays } from "State/Login";
|
import { addDirectMessage, addNotifications, setFollows, setRelays } from "State/Login";
|
||||||
import { RootState } from "State/Store";
|
import { RootState } from "State/Store";
|
||||||
import { mapEventToProfile, MetadataCache, find, put, bulkGet } from "State/Users";
|
import { mapEventToProfile, MetadataCache } from "State/Users";
|
||||||
|
import db from "State/Users/Db";
|
||||||
import useSubscription from "Feed/Subscription";
|
import useSubscription from "Feed/Subscription";
|
||||||
import { getDisplayName } from "Element/ProfileImage";
|
import { getDisplayName } from "Element/ProfileImage";
|
||||||
import { MentionRegex } from "Const";
|
import { MentionRegex } from "Const";
|
||||||
@ -80,9 +81,9 @@ export default function useLoginFeed() {
|
|||||||
return acc;
|
return acc;
|
||||||
}, { created: 0, profile: <MetadataCache | null>null });
|
}, { created: 0, profile: <MetadataCache | null>null });
|
||||||
if (maxProfile.profile) {
|
if (maxProfile.profile) {
|
||||||
let existing = await find(maxProfile.profile.pubkey);
|
let existing = await db.find(maxProfile.profile.pubkey);
|
||||||
if ((existing?.created ?? 0) < maxProfile.created) {
|
if ((existing?.created ?? 0) < maxProfile.created) {
|
||||||
await put(maxProfile.profile);
|
await db.put(maxProfile.profile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})().catch(console.warn);
|
})().catch(console.warn);
|
||||||
@ -93,7 +94,7 @@ async function makeNotification(ev: TaggedRawEvent) {
|
|||||||
switch (ev.kind) {
|
switch (ev.kind) {
|
||||||
case EventKind.TextNote: {
|
case EventKind.TextNote: {
|
||||||
const pubkeys = new Set([ev.pubkey, ...ev.tags.filter(a => a[0] === "p").map(a => a[1]!)]);
|
const pubkeys = new Set([ev.pubkey, ...ev.tags.filter(a => a[0] === "p").map(a => a[1]!)]);
|
||||||
const users = await bulkGet(Array.from(pubkeys))
|
const users = await db.bulkGet(Array.from(pubkeys))
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const fromUser = users.find(a => a?.pubkey === ev.pubkey);
|
const fromUser = users.find(a => a?.pubkey === ev.pubkey);
|
||||||
const name = getDisplayName(fromUser, ev.pubkey);
|
const name = getDisplayName(fromUser, ev.pubkey);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { HexKey, TaggedRawEvent } from "Nostr";
|
import { HexKey, TaggedRawEvent } from "Nostr";
|
||||||
import { ProfileCacheExpire } from "Const";
|
import { ProfileCacheExpire } from "Const";
|
||||||
import { mapEventToProfile, MetadataCache, add, bulkAdd, bulkGet, find, put, update, bulkPut } from "State/Users";
|
import { mapEventToProfile, MetadataCache, } from "State/Users";
|
||||||
|
import db from "State/Users/Db";
|
||||||
import Connection, { RelaySettings } from "Nostr/Connection";
|
import Connection, { RelaySettings } from "Nostr/Connection";
|
||||||
import Event from "Nostr/Event";
|
import Event from "Nostr/Event";
|
||||||
import EventKind from "Nostr/EventKind";
|
import EventKind from "Nostr/EventKind";
|
||||||
@ -166,7 +167,7 @@ export class NostrSystem {
|
|||||||
|
|
||||||
async _FetchMetadata() {
|
async _FetchMetadata() {
|
||||||
let missing = new Set<HexKey>();
|
let missing = new Set<HexKey>();
|
||||||
let meta = await bulkGet(Array.from(this.WantsMetadata));
|
let meta = await db.bulkGet(Array.from(this.WantsMetadata));
|
||||||
let expire = new Date().getTime() - ProfileCacheExpire;
|
let expire = new Date().getTime() - ProfileCacheExpire;
|
||||||
for (let pk of this.WantsMetadata) {
|
for (let pk of this.WantsMetadata) {
|
||||||
let m = meta.find(a => a?.pubkey === pk);
|
let m = meta.find(a => a?.pubkey === pk);
|
||||||
@ -189,18 +190,18 @@ export class NostrSystem {
|
|||||||
sub.OnEvent = async (e) => {
|
sub.OnEvent = async (e) => {
|
||||||
let profile = mapEventToProfile(e);
|
let profile = mapEventToProfile(e);
|
||||||
if (profile) {
|
if (profile) {
|
||||||
let existing = await find(profile.pubkey);
|
let existing = await db.find(profile.pubkey);
|
||||||
if((existing?.created ?? 0) < profile.created) {
|
if((existing?.created ?? 0) < profile.created) {
|
||||||
await put(profile);
|
await db.put(profile);
|
||||||
} else if(existing) {
|
} else if(existing) {
|
||||||
await update(profile.pubkey, { loaded: new Date().getTime() });
|
await db.update(profile.pubkey, { loaded: new Date().getTime() });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let results = await this.RequestSubscription(sub);
|
let results = await this.RequestSubscription(sub);
|
||||||
let couldNotFetch = Array.from(missing).filter(a => !results.some(b => b.pubkey === a));
|
let couldNotFetch = Array.from(missing).filter(a => !results.some(b => b.pubkey === a));
|
||||||
console.debug("No profiles: ", couldNotFetch);
|
console.debug("No profiles: ", couldNotFetch);
|
||||||
await bulkPut(couldNotFetch.map(a => {
|
await db.bulkPut(couldNotFetch.map(a => {
|
||||||
return {
|
return {
|
||||||
pubkey: a,
|
pubkey: a,
|
||||||
loaded: new Date().getTime()
|
loaded: new Date().getTime()
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
|
|||||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
|
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
|
||||||
import { HexKey, TaggedRawEvent, UserMetadata } from "Nostr";
|
import { HexKey, TaggedRawEvent, UserMetadata } from "Nostr";
|
||||||
import { hexToBech32 } from "../Util";
|
import { hexToBech32 } from "../Util";
|
||||||
import { db } from "Db";
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
import store from "State/Store";
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
|
||||||
export interface MetadataCache extends UserMetadata {
|
export interface MetadataCache extends UserMetadata {
|
||||||
/**
|
/**
|
||||||
@ -41,6 +39,18 @@ export function mapEventToProfile(ev: TaggedRawEvent) {
|
|||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface UsersDb {
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
isAvailable(): Promise<boolean>
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
query(str: string): Promise<MetadataCache[]>
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
find(key: HexKey): Promise<MetadataCache | undefined>
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
add(user: MetadataCache): Promise<any>
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
put(user: MetadataCache): Promise<any>
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
bulkAdd(users: MetadataCache[]): Promise<any>
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
bulkGet(keys: HexKey[]): Promise<MetadataCache[]>
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
bulkPut(users: MetadataCache[]): Promise<any>
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
update(key: HexKey, fields: Record<string, any>): Promise<any>
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
}
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
export interface UsersStore {
|
export interface UsersStore {
|
||||||
/**
|
/**
|
||||||
* A list of seen users
|
* A list of seen users
|
||||||
@ -60,87 +70,6 @@ const UsersSlice = createSlice({
|
|||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const { setUsers } = UsersSlice.actions
|
export const { setUsers } = UsersSlice.actions
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
function groupByPubkey(acc: Record<HexKey, MetadataCache>, user: MetadataCache) {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
return { ...acc, [user.pubkey]: user }
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
}
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
export const add = async (user: MetadataCache) => {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
try {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
return await db.users.add(user)
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
} catch (error) {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const state = store.getState()
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const { users } = state.users
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
store.dispatch(setUsers({...users, [user.pubkey]: user }))
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
}
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
}
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
export const bulkAdd = async (newUserProfiles: MetadataCache[]) => {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
try {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
return await db.users.bulkAdd(newUserProfiles)
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
} catch (error) {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const state = store.getState()
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const { users } = state.users
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const newUsers = newUserProfiles.reduce(groupByPubkey, {})
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
store.dispatch(setUsers({...users, ...newUsers }))
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
}
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
}
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
export const bulkGet = async (pubKeys: HexKey[]) => {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
try {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const ret = await db.users.bulkGet(pubKeys);
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
return ret.filter(a => a !== undefined).map(a => a!);
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
} catch (error) {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const state = store.getState()
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const { users } = state.users
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const ids = new Set([...pubKeys])
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
return Object.values(users).filter(user => {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
return ids.has(user.pubkey)
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
})
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
}
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
}
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
export const find = async (pubKey: HexKey) => {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
try {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const user = await db.users.get(pubKey);
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
return user
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
} catch (error) {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const { users } = store.getState()
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
return users.users[pubKey]
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
}
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
}
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
export const put = async (user: MetadataCache) => {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
try {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
await db.users.put(user)
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
} catch (error) {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const state = store.getState()
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const { users } = state.users
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
store.dispatch(setUsers({...users, [user.pubkey]: user }))
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
}
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
}
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
export const update = async (pubKey: HexKey, fields: Record<string, any>) => {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
try {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
await db.users.update(pubKey, fields)
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
} catch (error) {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const state = store.getState()
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const { users } = state.users
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const current = users[pubKey]
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
store.dispatch(setUsers({...users, [pubKey]: {...current, ...fields }}))
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
}
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
}
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
export const bulkPut = async (newUsers: MetadataCache[]) => {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
try {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
await db.users.bulkPut(newUsers)
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
} catch (error) {
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const state = store.getState()
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const { users } = state.users
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
const newProfiles = newUsers.reduce(groupByPubkey, {})
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
store.dispatch(setUsers({ ...users, ...newProfiles }))
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
}
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
}
|
|
||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
|||||||
|
|
||||||
export const reducer = UsersSlice.reducer;
|
export const reducer = UsersSlice.reducer;
|
||||||
|
|||||||
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a At startup we can test if indexdDb is available with This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then
At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
|
137
src/State/Users/Db.ts
Normal file
@ -0,0 +1,137 @@
|
|||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
import { HexKey } from "Nostr";
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
import { db as idb } from "Db";
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
import { UsersDb, MetadataCache, setUsers } from "State/Users";
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
import store from "State/Store";
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
class IndexedDb implements UsersDb {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
async isAvailable() {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
try {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const req = "indexedDb" in window && window.indexedDB.open('test', 1)
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
return Boolean(req)
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
} catch (error) {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
return false
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
find(key: HexKey) {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
return idb.users.get(key);
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
query(q: string) {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
return idb.users
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
.where("npub").startsWithIgnoreCase(q)
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
.or("name").startsWithIgnoreCase(q)
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
.or("display_name").startsWithIgnoreCase(q)
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
.or("nip05").startsWithIgnoreCase(q)
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
.limit(5)
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
.toArray()
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
bulkGet(keys: HexKey[]) {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
return idb.users.bulkGet(keys).then(ret => ret.filter(a => a !== undefined).map(a => a!));
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
add(user: MetadataCache) {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
return idb.users.add(user)
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
put(user: MetadataCache) {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
return idb.users.put(user)
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
bulkAdd(users: MetadataCache[]) {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
return idb.users.bulkAdd(users)
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
bulkPut(users: MetadataCache[]) {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
return idb.users.bulkPut(users)
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
update(key: HexKey, fields: Record<string, any>) {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
return idb.users.update(key, fields)
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
function groupByPubkey(acc: Record<HexKey, MetadataCache>, user: MetadataCache) {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
return { ...acc, [user.pubkey]: user }
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
class ReduxUsersDb implements UsersDb {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
async isAvailable() { return true }
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
async query(q: string) {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const state = store.getState()
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const { users } = state.users
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
return Object.values(users).filter(user => {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const profile = user as MetadataCache
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
return profile.name?.includes(q)
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|| profile.npub?.includes(q)
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|| profile.display_name?.includes(q)
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|| profile.nip05?.includes(q)
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
})
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
async find(key: HexKey) {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const state = store.getState()
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const { users } = state.users
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
return users[key]
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
async add(user: MetadataCache) {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const state = store.getState()
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const { users } = state.users
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
store.dispatch(setUsers({...users, [user.pubkey]: user }))
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
async put(user: MetadataCache) {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const state = store.getState()
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const { users } = state.users
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
store.dispatch(setUsers({...users, [user.pubkey]: user }))
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
async bulkAdd(newUserProfiles: MetadataCache[]) {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const state = store.getState()
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const { users } = state.users
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const newUsers = newUserProfiles.reduce(groupByPubkey, {})
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
store.dispatch(setUsers({...users, ...newUsers }))
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
async bulkGet(keys: HexKey[]) {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const state = store.getState()
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const { users } = state.users
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const ids = new Set([...keys])
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
return Object.values(users).filter(user => {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
return ids.has(user.pubkey)
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
})
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
async update(key: HexKey, fields: Record<string, any>) {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const state = store.getState()
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const { users } = state.users
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const current = users[key]
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const updated = {...current, ...fields }
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
store.dispatch(setUsers({...users, [key]: updated }))
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
async bulkPut(newUsers: MetadataCache[]) {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const state = store.getState()
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const { users } = state.users
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
const newProfiles = newUsers.reduce(groupByPubkey, {})
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
store.dispatch(setUsers({ ...users, ...newProfiles }))
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
}
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
export const indexedDb = new IndexedDb()
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
export const inMemoryDb = new ReduxUsersDb()
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
let db: UsersDb = inMemoryDb
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
indexedDb.isAvailable().then(() => {
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
console.debug('IndexedDB available')
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
db = indexedDb
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
})
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
|||||||
|
export default db
|
||||||
Might as well try to open the SnortDb so we dont have a random "test" db be there forever Might as well try to open the SnortDb so we dont have a random "test" db be there forever
This seems to create an empty database and not store anything inside? This seems to create an empty database and not store anything inside?
I'll go back to using a dummy I'll go back to using a dummy `test` db with version 1 then, wdyt?
Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
My bad, My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
|
@ -1,89 +1,51 @@
|
|||||||
`db.find`?
`db.find`?
|
|||||||
import { useMemo } from "react";
|
|
||||||
`db.find`?
|
|||||||
import { useSelector } from "react-redux";
|
|
||||||
`db.find`?
|
|||||||
import { useLiveQuery } from "dexie-react-hooks";
|
import { useLiveQuery } from "dexie-react-hooks";
|
||||||
|
|
||||||
`db.find`?
|
|||||||
import { RootState } from "State/Store";
|
|
||||||
`db.find`?
|
|||||||
import { MetadataCache } from "State/Users";
|
import { MetadataCache } from "State/Users";
|
||||||
|
import { indexedDb, inMemoryDb } from "State/Users/Db";
|
||||||
`db.find`?
|
|||||||
import { HexKey } from "Nostr";
|
import { HexKey } from "Nostr";
|
||||||
import { db } from "Db";
|
|
||||||
`db.find`?
|
|||||||
|
|
||||||
export function useQuery(query: string, limit: number = 5) {
|
export function useQuery(query: string, limit: number = 5) {
|
||||||
const { users } = useSelector((state: RootState) => state.users)
|
|
||||||
`db.find`?
|
|||||||
|
|
||||||
`db.find`?
|
|||||||
const inMemoryUsers = useMemo(() => {
|
|
||||||
`db.find`?
|
|||||||
return Object.values(users).filter(user => {
|
|
||||||
`db.find`?
|
|||||||
const profile = user as MetadataCache
|
|
||||||
`db.find`?
|
|||||||
return profile.name?.includes(query)
|
|
||||||
`db.find`?
|
|||||||
|| profile.npub?.includes(query)
|
|
||||||
`db.find`?
|
|||||||
|| profile.display_name?.includes(query)
|
|
||||||
`db.find`?
|
|||||||
|| profile.nip05?.includes(query)
|
|
||||||
`db.find`?
|
|||||||
})
|
|
||||||
`db.find`?
|
|||||||
}, [users, query])
|
|
||||||
`db.find`?
|
|||||||
|
|
||||||
`db.find`?
|
|||||||
const allUsers = useLiveQuery(
|
const allUsers = useLiveQuery(
|
||||||
() => db.users
|
() => indexedDb.query(query)
|
||||||
`db.find`?
`db.find`?
|
|||||||
.where("npub").startsWithIgnoreCase(query)
|
|
||||||
`db.find`?
|
|||||||
.or("name").startsWithIgnoreCase(query)
|
|
||||||
`db.find`?
|
|||||||
.or("display_name").startsWithIgnoreCase(query)
|
|
||||||
`db.find`?
|
|||||||
.or("nip05").startsWithIgnoreCase(query)
|
|
||||||
`db.find`?
|
|||||||
.limit(5)
|
|
||||||
`db.find`?
|
|||||||
.toArray()
|
|
||||||
`db.find`?
|
|||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
return inMemoryUsers
|
console.error(err)
|
||||||
`db.find`?
`db.find`?
|
|||||||
|
}).then(() => {
|
||||||
`db.find`?
|
|||||||
|
return inMemoryDb.query(query)
|
||||||
`db.find`?
|
|||||||
}),
|
}),
|
||||||
[query, inMemoryUsers],
|
[query],
|
||||||
`db.find`?
`db.find`?
|
|||||||
)
|
)
|
||||||
|
|
||||||
return allUsers
|
return allUsers
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useKey(pubKey: HexKey) {
|
export function useKey(pubKey: HexKey) {
|
||||||
const { users } = useSelector((s: RootState) => s.users)
|
|
||||||
`db.find`?
|
|||||||
|
|
||||||
`db.find`?
|
|||||||
const inMemoryUser = useMemo(() => {
|
|
||||||
`db.find`?
|
|||||||
return users[pubKey]
|
|
||||||
`db.find`?
|
|||||||
}, [users, pubKey])
|
|
||||||
`db.find`?
|
|||||||
|
|
||||||
`db.find`?
|
|||||||
const user = useLiveQuery(async () => {
|
const user = useLiveQuery(async () => {
|
||||||
if (pubKey) {
|
if (pubKey) {
|
||||||
try {
|
try {
|
||||||
return await db.users.get(pubKey);
|
return await indexedDb.find(pubKey);
|
||||||
`db.find`?
`db.find`?
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
return inMemoryUser
|
console.error(error)
|
||||||
`db.find`?
`db.find`?
|
|||||||
|
return await inMemoryDb.find(pubKey)
|
||||||
`db.find`?
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [pubKey, inMemoryUser]);
|
}, [pubKey]);
|
||||||
`db.find`?
`db.find`?
|
|||||||
|
|
||||||
return user
|
return user
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useKeys(pubKeys: HexKey[]): Map<HexKey, MetadataCache> {
|
export function useKeys(pubKeys: HexKey[]): Map<HexKey, MetadataCache> {
|
||||||
const { users } = useSelector((s: RootState) => s.users)
|
|
||||||
`db.find`?
|
|||||||
|
|
||||||
`db.find`?
|
|||||||
const inMemoryUsers = useMemo(() => {
|
|
||||||
`db.find`?
|
|||||||
const res = new Map()
|
|
||||||
`db.find`?
|
|||||||
Object.values(users).forEach(u => {
|
|
||||||
`db.find`?
|
|||||||
const profile = u as MetadataCache
|
|
||||||
`db.find`?
|
|||||||
if (pubKeys.includes(profile.pubkey)) {
|
|
||||||
`db.find`?
|
|||||||
res.set(profile.pubkey, profile)
|
|
||||||
`db.find`?
|
|||||||
}
|
|
||||||
`db.find`?
|
|||||||
})
|
|
||||||
`db.find`?
|
|||||||
return res
|
|
||||||
`db.find`?
|
|||||||
}, [users, pubKeys])
|
|
||||||
`db.find`?
|
|||||||
|
|
||||||
`db.find`?
|
|||||||
const dbUsers = useLiveQuery(async () => {
|
const dbUsers = useLiveQuery(async () => {
|
||||||
if (pubKeys) {
|
if (pubKeys) {
|
||||||
try {
|
try {
|
||||||
const ret = await db.users.bulkGet(pubKeys);
|
const ret = await indexedDb.bulkGet(pubKeys);
|
||||||
`db.find`?
`db.find`?
|
|||||||
// @ts-ignore
|
|
||||||
`db.find`?
|
|||||||
return new Map(ret.map(a => [a.pubkey, a]))
|
return new Map(ret.map(a => [a.pubkey, a]))
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return inMemoryUsers
|
console.error(error)
|
||||||
`db.find`?
`db.find`?
|
|||||||
|
const ret = await inMemoryDb.bulkGet(pubKeys);
|
||||||
`db.find`?
|
|||||||
|
return new Map(ret.map(a => [a.pubkey, a]))
|
||||||
`db.find`?
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new Map()
|
return new Map()
|
||||||
}, [pubKeys, inMemoryUsers]);
|
}, [pubKeys]);
|
||||||
`db.find`?
`db.find`?
|
|||||||
|
|
||||||
return dbUsers || inMemoryUsers
|
return dbUsers!
|
||||||
`db.find`?
`db.find`?
|
|||||||
}
|
}
|
||||||
|
|
||||||
`db.find`?
|
|||||||
|
|||||||
`db.find`?
`db.find`?
|
This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a
const SnortDb
we can haveconst db = SnortDb | ReduxDb
which both implement the users store, no need for try/catch thenAt startup we can test if indexdDb is available with
window.indexdDb.open("test").catch(() => "Not supported")
or something similar, at this point we initialize thedb
to beReduxDb
which implementsUsersDb
or some other interfaceThis is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a
const SnortDb
we can haveconst db = SnortDb | ReduxDb
which both implement the users store, no need for try/catch thenAt startup we can test if indexdDb is available with
window.indexdDb.open("test").catch(() => "Not supported")
or something similar, at this point we initialize thedb
to beReduxDb
which implementsUsersDb
or some other interfaceHey if you dont have time to make these changes maybe lets just merge it now and work on it later
Hey if you dont have time to make these changes maybe lets just merge it now and work on it later