-
Notifications
You must be signed in to change notification settings - Fork 2
fix: device lock status disappearing when unlocked #709
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
Conversation
|
Discussed in thread: https://hello-seam.slack.com/archives/C05FXN0QYH0/p1759185704232699 |
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.
useLockDoor/useUnlockDoor / use-(un)lock-door.ts
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.
src/lib/seam/components/DeviceDetails/LockDeviceLockButtons.tsx
Outdated
Show resolved
Hide resolved
| return ( | ||
| <div className='seam-content seam-lock-status'> | ||
| <div> | ||
| <span className='seam-label'>{t.lockStatus}</span> | ||
| <span className='seam-value'>{t.statusUnknown}</span> | ||
| </div> | ||
| <div className='seam-right'> | ||
| <Button | ||
| size='small' | ||
| onClick={() => { | ||
| lock.mutate(device) | ||
| }} | ||
| > | ||
| {t.lock} | ||
| </Button> | ||
| <Button | ||
| size='small' | ||
| onClick={() => { | ||
| unlock.mutate(device) | ||
| }} | ||
| > | ||
| {t.unlock} | ||
| </Button> | ||
| </div> | ||
| </div> | ||
| ) | ||
| } |
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.
For this last condition
Cannot lock or unlock = show unknown status + both lock/unlock buttons
We should not show ANY buttons or any row. If cannot lock or unlock then the buttons are not going to work.
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.
makes sense, thanks!
Co-authored-by: Evan Sosenko <evan@getseam.com>
Closes https://linear.app/seam/issue/CX-450/status-field-disappears-when-clicking-unlock-button-in-seam-components
Previously we were hiding the toggle to prevent the case where the device doesn't report lock status.
This PR conditionally renders buttons depending on whether the device has capability to unlock/lock:
Screenshots