So here:
I want to refresh page A but the refresh will trigger on page B. Is is any other way where it's not from the localstorage?
Because I'm working on an e-commerce website. And I want page A to refresh when a button on page B is clicked. So that the content of page A will be updated just like in page B.
To understand more:
page A is the order details screen for the customer or client page B is the order details screen for the partner or seller
So the idea is, when the partner/seller updated the order status (on the way, in the kitchen, complete) from page B, the page A will refresh so that the customer or client will see their updated order status.
I hope that makes sense. A help is really much appreciated. Thank you so much!
The scenario is pretty much like having an admin page and a client page. When updating status of a product's status from the admin page, we want to also update that of in the Client page.
I think you can use firebase/firestore: In the admin page you can update the document of a collection, for example product
const productRef = db.collection('product').doc('id_1');
const res = await productRef.set({
status: "active"
}, { merge: true });
In the client site, we can listen change on that collection's document For example:
firestore().collection('product').onSnapshot(querySnapshot => {
// handle changes to documents in the collection here
})
By doing that it solves a bigger problem where user can be any browser or devices...