Drei's Blog

Back to Good Vibes

February 15, 2022 | 2 Minute Read

This week was a shift in focus and bringing back the old project I was working on last semester: Good Vibes! It was really nice being able to work on something that I devoted a lot of time into and am familiar with compared to the Hendrix Assessment project I was working on the previous week. However, I would like to work on Hendrix Assessment more since there is so much for me to learn and get acquainted with since ASP.NET is very popular and I am rusty in HTML and CSS.

I was tasked with something that I had previously worked on that had caused a great deal of discussion, which was the system of quote interaction with the user. There were a number of shifts for what we as a team wanted to do with how users would keep or share quotes, where sometimes we believed users should only read a quote once and either share it or favorite it, and other times we wanted users to be able to favorite a quote and then share it later on or simply remove it. Now, the process is that when a user first opens a quote, they can either favorite it (to keep it and have the option to share the quote) or remove it, taking it out of their quote list. If a user favorites a quote, they can share it once, otherwise that option is taken away.

The issue I am currently running into is that when trying to remove a quote that has already been shared, the quote stays in the list until the user navigates to another page. This is because when a quote is shared, the document containing the quote information gets shared and the same quote gets duplicated from the local database and put back into the user’s list. The way that the quotes and documents work in the Firebase Firestore and how the quotes get added or removed immediately is different from quotes added from the local database. The snapshot and listeners allow changes to be made instantly with the subscription. However, with locally added quotes, removing is a tricker task. It seems that the widget does not get updated when the local quote is removed, even when setState is used on the parent widget. I am trying to figure out why that happens, so more investigating is being done.