-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement target swap/restore #158
Conversation
6636e26
to
7de34d5
Compare
@@ -0,0 +1,98 @@ | |||
import { useCanEdit } from '@/components/atoms/auth'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When reviewing, mainly look at this file
7de34d5
to
3ef2da5
Compare
@@ -23,17 +23,17 @@ export function OdbImport() { | |||
const rotator = useRotator().data?.rotator; | |||
|
|||
function updateObs() { | |||
updateConfiguration({ | |||
void updateConfiguration({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to learn 😅
Why is this void
needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question! I updated the linting rules to not allow "floating promises" which are promise-returning functions that are never awaited. It's a great rule that can catch bugs, but in cases like these where it's an event handler we have to "discard" the promise (void)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thank you for the explanation.
src/Helpers/toast.tsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, much better solution. It is like using shadcn/ui.
const [swapTarget, { loading: swapLoading }] = useSwapTarget(); | ||
const [restoreTarget, { loading: restoreLoading }] = useRestoreTarget(); | ||
|
||
const { data: instrumentData, loading: instrumentLoading } = useInstrument(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will cause the same problem we had in the tests last Friday, where instrument
was always undefined, because we are not passing the required variables name
, issPort
and wfs
.
3ef2da5
to
2a90231
Compare
2a90231
to
847930d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
useToast
hook that doesn't require adding a toast and ref for each component