-
Notifications
You must be signed in to change notification settings - Fork 112
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
fix: location does not display in inbox conversation #704
Conversation
frontend/src/components/inbox/components/GeolocationMessage.tsx
Outdated
Show resolved
Hide resolved
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.
Looks good, left a few comments.
frontend/src/components/inbox/components/GeolocationMessage.tsx
Outdated
Show resolved
Hide resolved
frontend/src/components/inbox/components/GeolocationMessage.tsx
Outdated
Show resolved
Hide resolved
const GeolocationMessage: React.FC<GeolocationMessageProps> = ({ message }) => { | ||
const iframeRef = useRef<HTMLDivElement>(null); | ||
|
||
if (!("coordinates" in message)) { |
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.
From my understanding any code after this check will have an existing message.coordinates and based on the StdIncomingLocationMessage type the lat and the lon are required fields.
I'm thinking, it is maybe required to test the existing of required fields and give them default values
or/and it's a adaption step to transform the response to a standard format 0 => 0.0
or/and it's better to a have a type adapted to the location response with optional props lat, lon
frontend/src/components/inbox/components/GeolocationMessage.tsx
Outdated
Show resolved
Hide resolved
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.
Motivation
This PR fixes a bug where when user sends their
location
it displays empty message in theinbox
Fixes #352
Type of change:
Please delete options that are not relevant.
Checklist: