From 9452fe92ba119754d95651535da3fede6100dbf1 Mon Sep 17 00:00:00 2001 From: vdua Date: Wed, 25 Sep 2024 20:01:29 +0530 Subject: [PATCH] bug: conversion checkpoint is lost on selecting any of the facet value fixes issue 638 --- tools/rum/slicer.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/rum/slicer.js b/tools/rum/slicer.js index a791a57c..35b2a872 100644 --- a/tools/rum/slicer.js +++ b/tools/rum/slicer.js @@ -311,6 +311,16 @@ export function updateState() { }); url.searchParams.set('domainkey', searchParams.get('domainkey') || 'incognito'); + // with the conversion spec in form of dictionary + // need to put it back in the url by expanding the dictionary as follows + // the key is appended to conversion. and there can be multiple values for the same key + // conversion.key=value1&conversion.key=value2 + Object.entries(conversionSpec).forEach(([key, values]) => { + values.forEach((value) => { + url.searchParams.append(`conversion.${key}`, value); + }); + }); + window.history.replaceState({}, '', url); document.dispatchEvent(new CustomEvent('urlstatechange', { detail: url })); }