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
[bug] Websocket connect error #63 #64
[bug] Websocket connect error #63 #64
Conversation
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.
Thank you for reporting this.
The expected behavior (which should happen in the device page), is:
- if mobile is checked, connect to the websocket server in order to receive the location data
- if no geographic position is present, show the message in
$noLocationDiv
(no location data received yet)
The actual behavior with this patch is still not satisfied, because it looks like location.val()
is always falsy in the location page, hence it cannot work.
We need to allow make sure location.val()
contains the ID of the location also in the location page.
Then we need to make sure the message is correctly displayed.
This change avoids the JS error but kind of hides the fact that the expected behavior is not honored.
38b5bce
to
cbb0e67
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.
Ah, I didn't notice the no location case error in the previous approach, this should fix it:
@@ -30,7 +30,7 @@ input[type=text]{ width: 320px } | |||
color: #333; | |||
} | |||
.no-location{ | |||
padding: 20px 0 0; | |||
padding: 10px 0 10px 0; |
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.
Changed this because in indoor device with no-location
message, there is no bottom padding which looks bad.
@@ -147,7 +147,7 @@ django.jQuery(function ($) { | |||
}); | |||
// name not relevant in mobile locations | |||
$name.parents('.form-row').hide(); | |||
$('.no-location').show(); | |||
if (!$geometryTextarea.val()) { $('.no-location').show(); } |
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.
If $geometryTextarea.val()
has a value, it's not hidden. Hence, map and the message appear together, this condition will help avoid that.
if ($location.val()) { | ||
$locationSelectionRow.hide(); | ||
$geoEdit.show(); | ||
isNew = false; | ||
pk = $location.val(); |
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.
Changing pk
value here should do the trick.
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.
Great, it works! Thanks 👍
Closes #63