Closed jennifer-dickinson closed 2 years ago
Hi @jennifersalas. You can create a listener for the Braze.Events.CONTENT_CARDS_UPDATED
event that will be fired after the refresh completes. You can call getContentCards()
inside the listener's callback to update your cards to the most recent set.
braze.addListener(Braze.Events.CONTENT_CARDS_UPDATED, cards => {
this.cards = braze.getContentCards();
});
braze.requestContentCardsRefresh();
We are currently using our own implementation for content cards UI, because of this we need to manually refresh the cards. However the
requestContentCardsRefresh
method does not return the value of the api call, so we're required to use thegetContentCards
method to receive the cards. The issue is, because therequestContentCardsRefresh
method is not await-able, we are receiving the previously cached set of cards. This leaves us with stale data, despite having pulled the most recent set of cards.This can be reproduced by