From e84691e459e7e192eef0b6f8fc9b8489bb9f528f Mon Sep 17 00:00:00 2001 From: Jonathan Staab Date: Fri, 4 Aug 2023 14:30:33 -0700 Subject: [PATCH] Fix AUTH --- package.json | 2 +- src/app/App.svelte | 3 ++- src/app/shared/NoteContentQuote.svelte | 7 ++++-- src/app/shared/PersonActions.svelte | 6 +++++ src/app/views/Notifications.svelte | 4 +-- src/engine/components/Alerts.ts | 4 +-- src/engine/components/Network.ts | 33 +------------------------ src/partials/OverflowMenu.svelte | 4 +-- yarn.lock | Bin 280749 -> 280749 bytes 9 files changed, 21 insertions(+), 42 deletions(-) diff --git a/package.json b/package.json index d1a18a02..5bd2dee2 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "marked": "^5.1.0", "nostr-tools": "^1.12.1", "npm-run-all": "^4.1.5", - "paravel": "^0.2.1", + "paravel": "^0.2.2", "qr-scanner": "^1.4.2", "qrcode": "^1.5.1", "ramda": "^0.28.0", diff --git a/src/app/App.svelte b/src/app/App.svelte index f9d801d0..860971cb 100644 --- a/src/app/App.svelte +++ b/src/app/App.svelte @@ -3,6 +3,7 @@ import "@fortawesome/fontawesome-free/css/solid.css" import type {ComponentType, SvelteComponentTyped} from "svelte" + import {nip19} from "nostr-tools" import type {Relay} from "src/engine" import {onMount} from "svelte" import {Router, links} from "svelte-routing" @@ -69,7 +70,7 @@ const TypedRouter = Router as ComponentType - Object.assign(window, {...engine, user, bech32ToHex, hexToBech32}) + Object.assign(window, {...engine, nip19, user, bech32ToHex, hexToBech32}) export let pathname = location.pathname export let hash = location.hash diff --git a/src/app/shared/NoteContentQuote.svelte b/src/app/shared/NoteContentQuote.svelte index 2354f217..7678434a 100644 --- a/src/app/shared/NoteContentQuote.svelte +++ b/src/app/shared/NoteContentQuote.svelte @@ -8,7 +8,7 @@ import Card from "src/partials/Card.svelte" import Spinner from "src/partials/Spinner.svelte" import PersonCircle from "src/app/shared/PersonCircle.svelte" - import {Directory, Nip65, user, Network} from "src/app/engine" + import {Directory, Settings, Nip65, user, Network} from "src/app/engine" export let note export let value @@ -23,7 +23,10 @@ const sub = Network.subscribe({ timeout: 5000, - relays: Nip65.mergeHints(3, [relays, Nip65.getEventHints(3, note)]), + relays: Nip65.mergeHints(Settings.getSetting("relay_limit"), [ + relays, + Nip65.getEventHints(3, note), + ]), filter: (id ? {ids: [id]} : filterVals(xs => xs.length > 0, { diff --git a/src/app/shared/PersonActions.svelte b/src/app/shared/PersonActions.svelte index 43ecbad0..dc3e4a92 100644 --- a/src/app/shared/PersonActions.svelte +++ b/src/app/shared/PersonActions.svelte @@ -39,6 +39,10 @@ }) } + if (!isSelf && false) { + actions.push({onClick: loginAsUser, label: "Login as", icon: "right-to-bracket"}) + } + if (Env.FORCE_RELAYS.length === 0) { actions.push({onClick: openProfileInfo, label: "Details", icon: "info"}) } @@ -52,6 +56,8 @@ } } + const loginAsUser = () => Keys.login("pubkey", pubkey) + const openProfileInfo = () => modal.push({type: "person/info", pubkey}) const share = () => modal.push({type: "person/share", pubkey}) diff --git a/src/app/views/Notifications.svelte b/src/app/views/Notifications.svelte index f368c009..6214c0d4 100644 --- a/src/app/views/Notifications.svelte +++ b/src/app/views/Notifications.svelte @@ -1,5 +1,5 @@