Skip to content

Commit

Permalink
Merge pull request #338 from snake-eaterr/name-service-fix
Browse files Browse the repository at this point in the history
Name service fix
  • Loading branch information
shocknet-justin authored Oct 18, 2024
2 parents 3c9f15d + e67e2f8 commit 7e41bfa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Components/Background.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const Background = () => {
const nostrSpends = useSelector(selectNostrSpends);
const paySource = useSelector((state) => state.paySource)
const { cursor, latestOperation: latestOp, operations: operationGroups, operationsUpdateHook } = useSelector(state => state.history)
const backupState = useSelector(state => state.backupStateSlice)
const nodedUp = useSelector(state => state.nostrPrivateKey);
const dispatch = useDispatch();
const [parsedClipboard, setParsedClipbaord] = useState<Destination>({
Expand Down Expand Up @@ -105,7 +106,7 @@ export const Background = () => {
const otherSpendSources = Object.values(spendSource.sources).filter((e) => !e.pubSource);

if ((nostrSpends.length !== 0 && nostrSpends[0].balance !== "0") || (otherPaySources.length > 0 || otherSpendSources.length > 0)) {
if (localStorage.getItem("isBackUp") == "1") {
if (localStorage.getItem("isBackUp") === "1" || backupState.subbedToBackUp) {
return;
}
dispatch(addNotification({
Expand Down
10 changes: 8 additions & 2 deletions src/State/bridgeMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ export const bridgeListener = {
const nostrPayTos = Object.values(paySources.sources).filter(source => source.pubSource);
await Promise.all(nostrPayTos.map(async source => enrollToBridge(
source,
(vanityName) => listenerApi.dispatch({ type: "paySources/editPaySources", payload: { ...source, vanityName }, meta: { skipChangelog: true } })
(vanityName) => {
const recentSource = listenerApi.getState().paySource.sources[source.id]
listenerApi.dispatch({ type: "paySources/editPaySources", payload: { ...recentSource, vanityName }, meta: { skipChangelog: true } })
}
)))
return;
}
Expand All @@ -70,7 +73,10 @@ export const bridgeListener = {

await enrollToBridge(
source,
(vanityName) => listenerApi.dispatch({ type: "paySources/editPaySources", payload: { ...source, vanityName }, meta: { skipChangelog: true } })
(vanityName) => {
const recentSource = listenerApi.getState().paySource.sources[source.id]
listenerApi.dispatch({ type: "paySources/editPaySources", payload: { ...recentSource, vanityName }, meta: { skipChangelog: true } })
}
)

}
Expand Down

0 comments on commit 7e41bfa

Please sign in to comment.