From 4e48aadc84cbb37f1c14507e50c9bb59c91022a7 Mon Sep 17 00:00:00 2001 From: smolgrrr Date: Mon, 19 Aug 2024 18:55:22 +1000 Subject: [PATCH] misc changes --- client/package.json | 4 ---- client/src/components/modals/Header.tsx | 4 ++-- client/src/components/routes/Hashtags.tsx | 2 +- client/src/components/routes/Settings.tsx | 6 ++--- client/src/utils/subscriptions.ts | 27 ++++++++++++++--------- 5 files changed, 23 insertions(+), 20 deletions(-) diff --git a/client/package.json b/client/package.json index 75d207a..0d336ec 100644 --- a/client/package.json +++ b/client/package.json @@ -3,16 +3,12 @@ "version": "0.1.0", "private": false, "dependencies": { - "@emoji-mart/data": "^1.1.2", - "@emoji-mart/react": "^1.1.1", "@headlessui/react": "1.7", "@heroicons/react": "^2.0.18", "@types/jest": "^27.5.2", "@types/node": "^17.0.45", "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", - "emoji-mart": "^5.5.2", - "emoji-picker-react": "^4.5.15", "link-preview-js": "^3.0.5", "nostr-tools": "2.5.1", "react": "^18.2.0", diff --git a/client/src/components/modals/Header.tsx b/client/src/components/modals/Header.tsx index 11f469c..43ae5ec 100644 --- a/client/src/components/modals/Header.tsx +++ b/client/src/components/modals/Header.tsx @@ -15,9 +15,9 @@ export default function Header() {
-
+
logo - + {`~/WIRED${lastPathPart}>`}
diff --git a/client/src/components/routes/Hashtags.tsx b/client/src/components/routes/Hashtags.tsx index 85b2a04..15ea117 100644 --- a/client/src/components/routes/Hashtags.tsx +++ b/client/src/components/routes/Hashtags.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; -export const DefaultHashtags = ['asknostr', 'politics', 'technology', 'bitcoin', 'wired']; +export const DefaultHashtags = ['asknostr', 'politics', 'technology', 'proofofwork','bitcoin', 'wired']; const Hashtags = () => { const [addedHashtags, setAddedHashtags] = useState(JSON.parse(localStorage.getItem('hashtags') as string) || []); diff --git a/client/src/components/routes/Settings.tsx b/client/src/components/routes/Settings.tsx index f986d4e..cc493c2 100644 --- a/client/src/components/routes/Settings.tsx +++ b/client/src/components/routes/Settings.tsx @@ -184,11 +184,11 @@ const Settings = () => {

About

-

The Anon Operation (TAO) is an anonymous-first agora, built upon the NOSTR protocol.

+

The Wired is an anon agora, built upon the NOSTR protocol.


-

TAO is built to facilitate unstoppable free speech on the internet.

+

The Wired is built to facilitate unstoppable free speech on the internet.

-PWA to be widely accessible with distribution via URLS, and to side-step App Store gatekeeping

-

-Uses NOSTR as a censorship-resistant global "social" network

+

-Uses NOSTR as a censorship-resistant "social" network

-Employs Proof-of-Work (PoW) as a spam prevention mechanism, as opposed to Captcha, moderation or other verification methods


diff --git a/client/src/utils/subscriptions.ts b/client/src/utils/subscriptions.ts index 95456e2..48ba040 100644 --- a/client/src/utils/subscriptions.ts +++ b/client/src/utils/subscriptions.ts @@ -298,6 +298,23 @@ export const subHashtagFeed = ( onEvent(evt, relay); }, filter: { + "#t": [hashtag], + kinds: [1, 6], + since: Math.floor((Date.now() * 0.001) - (age * 60 * 60)), + limit: 25, + }, + unsub: true + }); + + const prefix = Math.floor(16 / 4); // 4 bits in each '0' character + sub({ // get past events + cb: (evt, relay) => { + pubkeys.add(evt.pubkey); + notes.add(evt.id); + onEvent(evt, relay); + }, + filter: { + ...(prefix && { ids: ['0'.repeat(prefix)] }), "#t": [hashtag], kinds: [1, 6], since: Math.floor((Date.now() * 0.001) - (age * 60 * 60)), @@ -318,16 +335,6 @@ export const subHashtagFeed = ( unsub: true, }); pubkeys.clear(); - - sub({ - cb: onEvent, - filter: { - '#e': Array.from(notes), - kinds: [1], - }, - unsub: true, - }); - notes.clear(); }, 2000);