Skip to content

Fix: sensor should emit on_show every time it pops into view#3220

Open
alex-ds13 wants to merge 1 commit intoiced-rs:masterfrom
alex-ds13:fix-sensor
Open

Fix: sensor should emit on_show every time it pops into view#3220
alex-ds13 wants to merge 1 commit intoiced-rs:masterfrom
alex-ds13:fix-sensor

Conversation

@alex-ds13
Copy link
Contributor

If no on_hide is set, then the sensor was only emitting on_show once, the first time it popped into view. After that, if it popped out of view the has_popped_in variable wasn't being set to false so it thought the sensor was always in view and never emitted the on_show again.

If the user wants to have the behavior as it is currently (only emitting once), then it should be on them to implement that logic. The sensor should always emit what it "senses", that is it should always generate messages when it pops in and out of view.

- If no `on_hide` is set, then the sensor was only emitting `on_show`
  once, the first time it popped into view. After that, if it popped out
  of view the `has_popped_in` variable wasn't being set to `false` so it
  thought the sensor was always in view and never emitted the `on_show`
  again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant