diff --git a/.gitignore b/.gitignore index 13a88267..9a33a9db 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Logs logs *.log +*.pem npm-debug.log* yarn-debug.log* yarn-error.log* diff --git a/package-lock.json b/package-lock.json index ee7fc354..3f1faf18 100644 Binary files a/package-lock.json and b/package-lock.json differ diff --git a/package.json b/package.json index 64c363d1..93126b0b 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ "svelte": "^3.52.0", "tailwindcss": "^3.2.4", "typescript": "^4.9.5", - "vite": "^3.2.3" + "vite": "^3.2.3", + "vite-plugin-mkcert": "^1.13.0" }, "dependencies": { "@bugsnag/js": "^7.18.0", @@ -39,6 +40,7 @@ "localforage-memoryStorageDriver": "^0.9.2", "nostr-tools": "^1.2.1", "npm-run-all": "^4.1.5", + "qr-scanner": "^1.4.2", "qrcode": "^1.5.1", "ramda": "^0.28.0", "svelte-check": "^3.0.3", diff --git a/src/agent/sync.ts b/src/agent/sync.ts index 823c26e9..51ba16bf 100644 --- a/src/agent/sync.ts +++ b/src/agent/sync.ts @@ -105,7 +105,7 @@ const processRoomEvents = async events => { const content = tryJson(() => pick(roomAttrs, JSON.parse(e.content))) as Record const roomId = e.kind === 40 ? e.id : Tags.from(e).type("e").values().first() - if (!roomId) { + if (!roomId || !content) { continue } @@ -151,6 +151,7 @@ const processMessages = async events => { // Routes const getWeight = type => { + if (type === 'nip05') return 1 if (type === 'kind:10001') return 1 if (type === 'kind:3') return 0.8 if (type === 'kind:2') return 0.5 @@ -262,13 +263,12 @@ const verifyNip05 = (pubkey, as) => database.people.patch({...person, verified_as: as}) if (result.relays?.length > 0) { - console.log('===== NIP05 VERIFICATION RELAYS', result.relays) - // database.routes.bulkPut( - // createMap('id', result.relays.flatMap(url =>[ - // calculateRoute(pubkey, url, 'nip05', 'write', now()), - // calculateRoute(pubkey, url, 'nip05', 'read', now()), - // ])) - // ) + database.routes.bulkPut( + createMap('id', result.relays.filter(isRelay).flatMap(url =>[ + calculateRoute(pubkey, url, 'nip05', 'write', now()), + calculateRoute(pubkey, url, 'nip05', 'read', now()), + ])) + ) } } }, noop) diff --git a/src/routes/Bech32Entity.svelte b/src/routes/Bech32Entity.svelte index 83c1591b..4df3330c 100644 --- a/src/routes/Bech32Entity.svelte +++ b/src/routes/Bech32Entity.svelte @@ -2,7 +2,6 @@ import {objOf} from 'ramda' import {onMount} from 'svelte' import {nip19} from 'nostr-tools' - import {navigate} from 'svelte-routing' import Content from 'src/partials/Content.svelte' import NoteDetail from 'src/views/NoteDetail.svelte' import Person from 'src/routes/Person.svelte' @@ -16,7 +15,7 @@ ({type, data} = nip19.decode(entity) as {type: string, data: any}) relays = (data.relays || []).map(objOf('url')) } catch (e) { - navigate('/') + // pass } }) @@ -33,5 +32,9 @@ {:else if type === "npub"} +{:else} + +
Sorry, we weren't able to find {entity}.
+
{/if} diff --git a/src/routes/Person.svelte b/src/routes/Person.svelte index 787e7d5c..a541cea9 100644 --- a/src/routes/Person.svelte +++ b/src/routes/Person.svelte @@ -146,7 +146,7 @@ {/if} {/if} - + diff --git a/src/routes/Search.svelte b/src/routes/Search.svelte index f04419a0..c8e65d1e 100644 --- a/src/routes/Search.svelte +++ b/src/routes/Search.svelte @@ -1,26 +1,20 @@ - - - - + {#if activeTab === 'people'} - - {:else if activeTab === 'notes'} - + + {:else if activeTab === 'advanced'} + {/if} diff --git a/src/views/PersonShare.svelte b/src/views/PersonShare.svelte index a4efd0f6..6d7160e7 100644 --- a/src/views/PersonShare.svelte +++ b/src/views/PersonShare.svelte @@ -28,4 +28,7 @@