Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"@size-limit/preset-small-lib": "^8.1.0",
"@tsconfig/create-react-app": "^1.0.3",
"@tsconfig/recommended": "^1.0.1",
"@types/base-64": "^1.0.2",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@typescript-eslint/eslint-plugin": "^5.47.0",
Expand All @@ -68,6 +69,7 @@
"typescript": "^4.9.4"
},
"dependencies": {
"base-64": "^1.0.0",
"jotai": "^1.12.1",
"nostr-tools": "^1.1.0"
}
Expand Down
4 changes: 2 additions & 2 deletions src/core.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from "react"

import { Relay, Filter, Event as NostrEvent, relayInit, Sub } from "nostr-tools"
import { encode as btoa } from "base-64";

import { uniqBy } from "./utils"

Expand Down Expand Up @@ -178,8 +179,7 @@ export function useNostrEvents({
let onDoneCallback: null | OnDoneFunc = null

// Lets us detect changes in the nested filter object for the useEffect hook
const filterBase64 =
typeof window !== "undefined" ? window.btoa(JSON.stringify(filter)) : null
const filterBase64 = btoa(JSON.stringify(filter))

const _unsubscribe = (sub: Sub, relay: Relay) => {
log(
Expand Down
Loading