Skip to content

Commit

Permalink
fix: hostd lastannouncement error saving config
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Jan 24, 2024
1 parent 55c5f9c commit 4dbb448
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/twenty-seals-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'hostd': minor
---

Fixed an error with "lastAnnouncement" that occurs the first time the configuration is saved.
4 changes: 2 additions & 2 deletions apps/hostd/contexts/config/useOnValid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function useOnValid({
throw Error(response.error)
}
const needsToAnnounce =
host.data.lastAnnouncement?.address !== values.netAddress
host.data?.lastAnnouncement?.address !== values.netAddress
if (needsToAnnounce) {
triggerSuccessToast(
'Settings have been saved. Address has changed, make sure to re-announce the host.',
Expand All @@ -69,7 +69,7 @@ export function useOnValid({
console.log(e)
}
},
[showAdvanced, resources, settingsUpdate, revalidateAndResetForm, host]
[showAdvanced, resources, settingsUpdate, revalidateAndResetForm, host.data]
)
return onValid
}

0 comments on commit 4dbb448

Please sign in to comment.