Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #305

Merged
merged 1 commit into from
Sep 19, 2024
Merged

fix #305

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: 1 addition & 1 deletion src/Api/pub/autogenerated/ts/nostr_client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file was autogenerated from a .proto file, DO NOT EDIT!
import { NostrRequest } from './nostr_transport.js'
import * as Types from './types.js'
import * as Types from './types'
export type ResultError = { status: 'ERROR', reason: string }

export type NostrClientParams = {
Expand Down
12 changes: 9 additions & 3 deletions src/Pages/LinkedApp/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,23 @@ export const LinkedApp = () => {
getNostrClient({ pubkey, relays }, source.keys).then(c => {
c.GetDebitAuthorizations().then(res => {
if (res.status === "OK") {
setDebitAuthorizations((state) => [...state, ...res.debits])
setDebitAuthorizations((state) => [
...state,
...res.debits.filter(
debit => !state.some(stateDebt => stateDebt.debit_id === debit.debit_id)
)
])
}
})

})
});
}, [nostrSpends, nodedUp, toggle, updatehook])
}, [nostrSpends, nodedUp, updatehook])
useEffect(() => {
if (!nodedUp) {
return;
}
console.log("inside")
nostrSpends.forEach(source => {
const { pubkey, relays } = parseNprofile(source.pasteField)
getNostrClient({ pubkey, relays }, source.keys).then(c => {
Expand All @@ -45,7 +51,7 @@ export const LinkedApp = () => {
})
})
});
}, [nostrSpends, nodedUp, toggle])
}, [nostrSpends, nodedUp])
const authroizeRequest = useCallback(async (request: SourceDebitRequest) => {
const res = await (await getNostrClient(request.source.pasteField, request.source.keys)).AuthorizeDebit({ authorize_npub: request.request.npub, rules: [] });
if (res.status !=="OK") {
Expand Down