Commit ed41a5ea authored by Vũ Hoàng Anh's avatar Vũ Hoàng Anh

fix: expose currentProduct to window global context for external json viewer module

parent 5ac1c275
......@@ -804,6 +804,7 @@
// ═══ STATS & OVERVIEW ═══
async function showOverview() {
currentProduct = null;
window.currentProduct = null;
document.querySelectorAll('.fm-item').forEach(e => e.classList.remove('active'));
// Reset right header content
......@@ -1054,6 +1055,7 @@
if (data.status !== 'success') throw new Error(data.message);
currentProduct = data.product;
window.currentProduct = currentProduct;
currentSimilarItems = currentProduct.parsed_similar_items || [];
currentOutfits = currentProduct.parsed_outfit_recommendations || [];
......@@ -1110,6 +1112,7 @@
if (data.status !== 'success') throw new Error(data.message);
currentProduct = data.product;
window.currentProduct = currentProduct;
currentSimilarItems = currentProduct.parsed_similar_items || [];
currentOutfits = currentProduct.parsed_outfit_recommendations || [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment