Is there a way to make the page refresh after deleting a message from the firebase database? Because when I delete a post from the app I have to exit and re-enter the page to see if it was deleted
It depends on how this is set up. Are you deleting the info in firebase, or the app to trigger this? What triggers the refresh would be helpful, as it will be easier to trigger the refresh if a user clicks a button in the UI to delete the data.
- If the user clicks a button to delete the data, you can either perform a new get request, or try to reopen the same page. I do not think a page refresh is the answer as it could mess with page variables and other things. Consider calling for the info again.
- If you need to trigger when the data is deleted on the back end, then you need to update your logic to perform the necessary action when the get request returns empty. The easiest route is to look at the video below and simply update the data int he app on regular intervals (factoring in the increased usage).
The video below shows how to limit api calls, in this case this shows how often a given page is accessing the data.
I have a trash icon, for the icon logic I used delete record component from the market store
If you show your app and what you want it will be easier. I dont know if you want the page to disappear, or remove the data.
Then when the button is clicked after the delete record, you will need to either reopen the page (unsure if this would work), or simply try to use the get record again.
The easiest option it to reset the data/page/app variable after the delete record function completes so the user sees its deleted.