Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mothana committed Sep 18, 2024
1 parent bf384d5 commit 861a53c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
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

0 comments on commit 861a53c

Please sign in to comment.