cleanup
This commit is contained in:
parent
3ffe4d5b19
commit
d754551ebb
@ -1,3 +1,4 @@
|
||||
export * from "./legacy"
|
||||
import "./nostr-object"
|
||||
|
||||
// TODO This file should only contain re-exports and only re-export what is needed
|
||||
|
@ -7,7 +7,6 @@ declare global {
|
||||
getPublicKey: () => Promise<PublicKey>
|
||||
signEvent: <T extends RawEvent>(event: Unsigned<T>) => Promise<T>
|
||||
|
||||
// TODO It's unclear to me if I should use this anywhere.
|
||||
getRelays?: () => Promise<{
|
||||
[url: string]: { read: boolean; write: boolean }
|
||||
}>
|
||||
|
@ -41,9 +41,9 @@ export async function setup(
|
||||
const publisherSecret =
|
||||
"nsec15fnff4uxlgyu79ua3l7327w0wstrd6x565cx6zze78zgkktmr8vs90j363"
|
||||
|
||||
// Set up the global window.nostr object for the publisher.
|
||||
if (typeof window !== "undefined") {
|
||||
if (window.location.pathname === "/nostr-object") {
|
||||
// Mock the global window.nostr object for the publisher.
|
||||
window.nostr = {
|
||||
getPublicKey: () => Promise.resolve(parsePublicKey(publisherPubkey)),
|
||||
signEvent: <T extends RawEvent>(event: Unsigned<T>) =>
|
||||
@ -74,7 +74,7 @@ export async function setup(
|
||||
},
|
||||
}
|
||||
} else {
|
||||
// Otherwise, disable the user's nostr extension if they have one.
|
||||
// Disable the user's nostr extension if they have one.
|
||||
window.nostr = undefined
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user