[object Object]

← back to Dw Pairs Well

preview.html: gate default DWRW-74991 init on window.__deepLinkLoaded — fixes race where ?handle=izara… deep-link loaded correctly then got clobbered by the trailing default loadSource (caught via chrome-devtools MCP repro 2026-05-13; verified by reload showing only 2 fetches both for the Izara handle, color story renders SW/DE/BM/F&B paint matches)

fb9ee0573e8383216fc9a54630ffaf8674eff994 · 2026-05-13 12:17:14 -0700 · Steve

Files touched

Diff

commit fb9ee0573e8383216fc9a54630ffaf8674eff994
Author: Steve <steve@designerwallcoverings.com>
Date:   Wed May 13 12:17:14 2026 -0700

    preview.html: gate default DWRW-74991 init on window.__deepLinkLoaded — fixes race where ?handle=izara… deep-link loaded correctly then got clobbered by the trailing default loadSource (caught via chrome-devtools MCP repro 2026-05-13; verified by reload showing only 2 fetches both for the Izara handle, color story renders SW/DE/BM/F&B paint matches)
---
 public/preview.html | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/public/preview.html b/public/preview.html
index 4a53c85..52aa1e2 100644
--- a/public/preview.html
+++ b/public/preview.html
@@ -436,10 +436,13 @@
   quickBtns.forEach(function (b) { b.addEventListener('click', function () { loadSource(b.getAttribute('data-sku')); }); });
 
   // Deep-link: ?handle=... or ?sku=... or ?key=... auto-loads on page open.
+  // Sets `window.__deepLinkLoaded` so the default loadSource init at the bottom
+  // doesn't race + overwrite this load (caught 2026-05-13 — deep-link Izara
+  // fetched correctly but was clobbered by the trailing DWRW-74991 default).
   (function () {
     var params = new URLSearchParams(window.location.search);
     var k = params.get('handle') || params.get('sku') || params.get('key');
-    if (k) loadSource(k.trim());
+    if (k) { window.__deepLinkLoaded = true; loadSource(k.trim()); }
   })();
 
   cta.addEventListener('click', function () {
@@ -456,7 +459,7 @@
     if (section._catalogPairs) renderGrid(catalogGrid, section._catalogPairs);
   });
 
-  loadSource('DWRW-74991');
+  if (!window.__deepLinkLoaded) loadSource('DWRW-74991');
 </script>
 </body>
 </html>

← d7926be pairs/coordinate: accept ?palette=#hex,#hex,... for external  ·  back to Dw Pairs Well  ·  CORS_ORIGIN: add wallco.ai (+ www variants, local dev) — wal c7d0bfc →