Firebase data changed block bug or issue?

hi

it’s said the data changed block event is triggered when data are modified but what i see it’s triggered on every initialisation of screen . how can i avoid this ?

regards

You did not show an example of the Blocks you are using. How can you expect anyone to recommend how to ‘avoid this.’

A guess is when you change screens, you have code in the Screenxxx.Initialize block that prompts a query. You can fix that by changing your instructions or instead of changing Screens, use Virtual Screens using Layouts. We cannot see your Blocks, so we really don’t know what you coded.

Set a global variable . Firststart = True

On Text Change If Firststart = true, skip, and set Firststart = false
else — Do what it is you do.

solution taken from here


thank you Cian!

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

hi

I’m sorry but I don’t understand the answer what is the relationship between data changed and text changed especially as I use text changed for something else

what i’m doing ? it’s to turn app who works on one device working on two or three others devices

regards

Text/Data the same thing…however there is no textChanged event in AppInventor.

Just set the FirstStart variable to ensure that on screen initialisation that the dataChanged event does not fire, but after that it will fire.